Forum Moderators: open

Message Too Old, No Replies

How can i print a piece of the web page

print web page

         

justify

7:28 am on Apr 6, 2004 (gmt 0)

10+ Year Member



Hi, I have an asp page. I get some results in the getdata.asp after some find process. I want to print this page but only piece of the web page. I use <a href="javascript:window.print()">Print Page</a> script. This script print all page. I want to print only between <table> click for print only this between this tag information</table> How can I do please help Thanks for now.

RossWal

4:34 pm on Apr 6, 2004 (gmt 0)

10+ Year Member



I think you could use divs to eclose the part you don't want to print, then hide them, print, show them. Or maybe you even just print 1 div. Not sure on that.

HTH,
Ross

Xoc

7:56 pm on Apr 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the header of the page, add a line like this (if you already have a css link, add this one in addition to the one you already have):

<link rel="stylesheet" type="text/css" href="print.css" media="print"></link>

Mark the things you don't want to print, by adding a css class to them:

<img class="logo" src="thiswontprint.gif" />
<p>This will print</p>
<div class="someclass">this won't print either</div>

Then in the print.css file, put in css commands to hide all of the things you don't want to print.

.logo, .someclass
{
display:none;
}

This technique works really well for hiding menus, ads, and other extraneous stuff when you print.

RossWal

8:28 pm on Apr 7, 2004 (gmt 0)

10+ Year Member



Much more elegant Xoc.

Thanks!