How to make Asp.net Gridview header and first column frezee?
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.
I will try to put a div with another table of the same size inside the header table, and with css put the overflow scroll... but you have to be very carefull with your mesurments so they match... the headers witdth with the columns width...
Its tricky but I think it can work.
精彩评论