滚动表体时无法冻结表头。
我使用了以下I代码。
使用的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>发布于 2013-10-23 13:24:55
您可以使用jqgrid来实现您的目的。只需导入jqgrid插件,就可以轻松地将html表转换为jqgrid。在3.3版本中的新http://trirand.com/blog/jqgrid/jqgrid.html -HTML表到网格。这可能会帮助你解决这个问题,你可以做分页,排序,在表格中搜索将默认可用。
https://stackoverflow.com/questions/19532532
复制相似问题