滚动表体时无法冻结标题。
我使用了followind代码。
CSS已使用:
THEAD TH{
POSITION: relative;
Z-INDEX: 20;
TOP: expression(document.getElementById("tableData").scrollTop-1);
}
jsp代码:
<div id="tableData"
style="position: absolute; width: 96%; height: 260px; z-index: 1; left: 20px; top: 230px; overflow: auto">
<table id="summaryTable" border="0" cellspacing="1" cellpadding="2" bgcolor="#ebcaff" width='100%'>
<thead>
<tr>
<th>aaaaa</th>
<th>aaaaa</th>
<th>aaaaa</th>
<th>aaaaa</th>
</tr>
</thead>
<tbody>
<tr>
<td>bbbbb</td>
<td>bbbbb</td>
<td>bbbbb</td>
<td>bbbbb</td>
</tr>
</tbody>
</table>
</div>
答案 0 :(得分:1)
您可以将jqgrid用于您的目的。通过简单地导入jqgrid插件,可以轻松地将html表转换为jqgrid。版本3.3中的新增内容中的http://trirand.com/blog/jqgrid/jqgrid.html - HTML表格到网格。这可能有助于您解决问题,您可以在默认情况下进行分页,排序,搜索表。