how to make html table header and first column frezee, my code is not work all web browser.
Link: http://jsfiddle.net/avFBx/
How to make ?
css code:
.tbl th
{
background-color: Aqua;
position: relative;
}
.locked
{
background-color: Red;
position: relative;
}
#divgrid
{
height: 150px;
width: 350px;
overflow: auto;
}
html code:
<div id="divgrid">
<table class="tbl">
<tr>
<th class="locked">
a
</th>
<th>
b
</th>
<th>
c
</th>
<th>
d
</th>
<th>
e
</th>
</tr>
<tr>
<td class="locked">
aaaaaaaaaaaaaaaa
</td>
<td>
aaaaaaaaaaaaaaaa
</td>
<td>
aaaaaaaaaaaaaaaa
</td>
<td>
aaaaaaaaaaaaaaaa
</td>
<td>
aaaaaaaaaaaaaaaa
</td>
</tr>
</table>
</div>
Check this demo out: FixedHeaderTable.com
It is entirely jQuery and does exactly what you’re looking for.