<table border="1" style="height:50px; overflow:auto;">
<thead>
<tr>
<th>Col 1
</th>
<th>Col 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cell 3
</td>
<td>Cell 4
</td>
</tr>
<tr>
<td>Cell 5
</td>
<td>Cell 6
</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
我希望上面的表格高度为50px,因此滚动条会在内容增长时启动,但我也喜欢将表头(thead)固定在顶部,而其他内容可以滚动.是否有解决方案,最好使用jQuery?
在此先感谢您的帮助.
| 归档时间: |
|
| 查看次数: |
21990 次 |
| 最近记录: |