Tables - Fixed headers with scrolling body

liunx

Guest
I have a large HTML table and want to fix the headers and have a scrolling body, in IE5. I have read that using THEAD and TBODY should solve this, but I have tried this and it doesn't work. Am I doing something wrong, or is the specification incorrect? Is there any other way of doing this, other than using IFRAME which I don't really want to use?<br />
<br />
Thanks in advance!<!--content-->well Tbody and Thead are IE specific tags. Netscape will ignore them. So they don't mean that a table will scroll. Tables can't scroll, but you can put the text in a div tag that can scroll.<br />
<br />
<td> <br />
<div style="width: 50; height:20; overflow-y: scroll"> <br />
Four score and seven years ago our forefathers... <br />
</div> <br />
</td><!--content-->TBODY and THEAD are W3C elements, introduced in HTML 4.0. They were designed to facilitate the type of scrolling that you're after, as well as rendering tables for non-visual (eg. speech) browsers.<br />
Unfortunately no browsers currently support the scrolling functionality, so you have to fudge it:<br />
<br />
<br />
<table><br />
<tr><br />
<td><br />
<table id="fixedHeadingtable"><br />
<tr><br />
<td>Item 1</td><td>Item 2</td><td>Item 3</td> <br />
</tr><br />
</table><br />
</td><br />
</tr><br />
<tr><br />
<td><br />
<div style="overflow: auto; height:150px;"><br />
<table id="scrollingDataTable"><br />
<tr><br />
<td>Item 1</td><td>Item 2</td><td>Item 3</td> <br />
</tr><br />
....<br />
</table><br />
</div><br />
</td><br />
</tr><br />
</table><!--content-->Thanks Jon, But I remembered rwading something about it was IE specific. but who knows where that site is.<!--content-->Thanks for the replies! I'll give it a go when I go back to work on Monday, and let you know how I get on. It worked fine! Thanks<!--content-->
 
Back
Top