thankyou for the solution, i tried it and it works fine.
but i have to modify this a little....
i generate like 300 different tables on my asp page, now what i want
is a button or a link on top of every table which says 'Print this
page' and when a user clicks on any one of these links then only that
page (or table) should get printed and nothing else.
The code underneath should help you. Not sure about browser memory
issues if you plan to use that for 300 tables -> you need to test
that. Or you can split up the ASP pages so that less than 300 tables
are shown per page.
<html>
<head>
<style media="print">
..onlyscreen
{
display: none;
}
..printerandscreen
{
display: block;
}
</style>
<script language="javascript">
function reset_classes()
{
t1.className='onlyscreen';
t2.className='onlyscreen';
t3.className='onlyscreen';
}
</script>
</head>
<body>
<table border=1 id=t1 class=onlyscreen>
<tr>
<td><input
type=button
value=print
onClick="reset_classes();
t1.className='printerandscreen';
window.print();"
</td>
</tr>
</table>
<table border=1 id=t2 class=onlyscreen>
<tr>
<td><input
type=button
value=print
onClick="reset_classes();
t2.className='printerandscreen';
window.print();"
</td>
</tr>
</table>
<table border=1 id=t3 class=onlyscreen>
<tr>
<td><input
type=button
value=print
onClick="reset_classes();
t3.className='printerandscreen';
window.print();"
</td>
</tr>
</table>
</body>
</html>