robrodp
asked on
Need top n rows in an html table fixed
Need top n rows in an html table fixed so they are always visible when I scroll down a table
ASKER
Either they are too complicated or dont work across browsers.
Somebody must have a simple and elegant solution. Just plain HTML5, no plugings etc
Somebody must have a simple and elegant solution. Just plain HTML5, no plugings etc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Create two tables one with fixed rows and other with scrollable height.
<html>
<head>
<title></title>
</head>
<body>
<table style="width: 300px" cellpadding="0" cellspacing="0">
<tr>
<td>
Column 1
</td>
<td>
Column 2
</td>
</tr>
</table>
<div style="overflow: auto; height: 100px; width: 320px;">
<table style="width: 300px;" cellpadding="0" cellspacing="0">
<tr>
<td>
Value 1
</td>
<td>
Value 2
</td>
</tr>
<tr>
<td>
Value 1
</td>
<td>
Value 2
</td>
</tr>
<tr>
<td>
Value 1
</td>
<td>
Value 2
</td>
</tr>
<tr>
<td>
Value 1
</td>
<td>
Value 2
</td>
</tr>
<tr>
<td>
Value 1
</td>
<td>
Value 2
</td>
</tr>
<tr>
<td>
Value 1
</td>
<td>
Value 2
</td>
</tr>
</table>
</div>
</body>
</html>
http://www.matts411.com/post/super_tables/
http://www.tablefixedheader.com/demonstration/
http://stackoverflow.com/questions/673153/html-table-with-fixed-headers
http://stackoverflow.com/questions/684211/html-table-with-fixed-headers-and-a-fixed-column
http://rcswebsolutions.wordpress.com/2007/01/02/scrolling-html-table-with-fixed-header/