Einstein47
Programmer
Hey all,
I have a strange problem. I found this code that keeps the header of a table at the top and allows the user to scroll the table data in a small DIV. It works great for online, but when the user wants to print the page and the table contains a lot of data, only the first so many lines get printed.
Here is the code snip for my DIV and TABLE:
This only works in IE, but it is really slick for online viewing of large tables of data. You need to make sure that the number in the cellspacing matches the number subtracted from the scrolltop.
I would love to know what to do so that when the page is printed the div is ignored. Is that even possible?
Thanks in advance - and if you want to use this lock table head row or have any questions about it - feel free to ask.
Einstein47
(For best results: hand wash in cold, tumble dry low. For not so good results: drag through puddles, pound on rocks, air dry on tree branch.)
I have a strange problem. I found this code that keeps the header of a table at the top and allows the user to scroll the table data in a small DIV. It works great for online, but when the user wants to print the page and the table contains a lot of data, only the first so many lines get printed.
Here is the code snip for my DIV and TABLE:
Code:
<DIV style="height: 50%; overflow: auto;">
<TABLE border="0" cellspacing="2" cellpadding="1" width="100%">
<THEAD>
<TR class="tableHeadDark" style="position:relative;top:expression(this.offsetParent.scrollTop-2);">
<TH>COL 1</TH>
<TH>COL 2</TH>
<TH>COL 3</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>Data</TD>
<TD>Data</TD>
<TD>Data</TD>
</TR>
....
</TBODY>
</TABLE>
</DIV>
I would love to know what to do so that when the page is printed the div is ignored. Is that even possible?
Thanks in advance - and if you want to use this lock table head row or have any questions about it - feel free to ask.
Einstein47
(For best results: hand wash in cold, tumble dry low. For not so good results: drag through puddles, pound on rocks, air dry on tree branch.)