<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>
我希望上面的表格高度为 50px,这样当内容增长时滚动条就会启动,但我也希望表格标题 (thead) 始终固定在顶部,而其他内容可以滚动。有没有更好的解决方案,使用 jQuery?
在此先感谢您的帮助。