Thanks,
Erez
<HTML>
<HEAD>
<TITLE>
scrollable table body
</TITLE>
</HEAD>
<BODY>
<TABLE BORDER="1">
<THEAD>
<TR><TH>No.</TH>
<TH>Name</TH></TR>
</THEAD>
<TBODY STYLE="overflow: auto;
height: 300px;"
>
<SCRIPT>
for (var r = 0; r < 50; r++)
document.write('<TR><TD ALIGN="right">' + r
+ '<\/TD><TD WIDTH="75">Kibo ' + r + '<\/TD><\/TR>');
</SCRIPT>
</TBODY>
</TABLE>
</BODY>
</HTML>
Netscape and Mozilla are the only browsers that support this. I don't know
if it's a standard or whatever. But, if you want fixed headers in
non-Mozilla browsers, you'll probably have to use frames or just send them
an actual spreadsheet file.
(There are things HTML is just not ready to display nicely yet.)
> Hello all,
> I have a table with many rows. The table should have a
> scrollbar,however the table headers should not to be scrolled.
> In NN the following html works fine.
> In IE5, it doesn't work.
> Do you have any idea how can I make the headers freeze (splitting the
> table into two tables, isn't a good solution for me be)
>
> Thanks,
> Erez
>
> <TBODY STYLE="overflow: auto; height: 300px;"
This has been my solution, but like you noticed, only Mozilla implements
it at this time. Also, be warned that if the text on your last column is
too long, the last letter or so might be cut off by the scrollbar (see
<http://bugzilla.mozilla.org/show_bug.cgi?id=28800> and the 4th attachment
there).
There's also another bug that if you use 'max-height' instead of 'height',
the tbody does not display.
Brucie posted another answer to your question. Because it uses nested
tables, you will need to know the exact width of your table cells so that
the header cells and the body cells line up.
hn
"erez" <egree...@jacada.com> wrote in message
news:d145490.02061...@posting.google.com...