View Full Version : Print in Javascript

02-03-2005, 10:58 AM
I want to print a perticular portion of the page
i mean only a table from the whole page how can i??

02-03-2005, 12:08 PM
just use CSS print styles to hide the portions of the page you don't want printed. there's no need for JS at all.

02-03-2005, 12:30 PM
<style media="print">
.noPrint {display:none;}
<p> will print this</p>
<p class = "noPrint"> won't print this or anything else with this class</p>
<a href = "#" class = "noPrint" onclick = "javascipt:print()">Print this</a>
Hope this helps