Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scroll table body

1 view
Skip to first unread message

erez

unread,
Jun 11, 2002, 12:53:43 PM6/11/02
to
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

<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>

spag

unread,
Jun 11, 2002, 4:59:21 PM6/11/02
to
"erez" <egree...@jacada.com> wrote in message
news:d145490.02061...@posting.google.com...

> 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)

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.)


WeSaySo

unread,
Jun 12, 2002, 2:31:43 PM6/12/02
to
egree...@jacada.com (erez) said in comp.infosystems.www.authoring.html:

> 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

Sean Crow

unread,
Jun 21, 2002, 3:43:57 AM6/21/02
to
I.E Can do this, check out examples on using the dhtml property
DATAPAGESIZE.


"erez" <egree...@jacada.com> wrote in message
news:d145490.02061...@posting.google.com...

0 new messages