View Full Version : Print in Javascript

02-03-2005, 09: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, 11:08 AM
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, 11:30 AM
<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