我想讓表格標題固定。表格存在於可滾動的div內。請在此處查看我的代碼:http://jsfiddle.net/w7Mm8/114/請向我建議解決方案。如何使用CSS固定標題製作可滾動表格
感謝
我的代碼:
<div style="position: absolute; height: 200px; overflow: auto; ">
<div style="height: 250px;">
<table border="1">
<th>head1</th>
<th>head2</th>
<th>head3</th>
<th>head4</th>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
<td>row 1, cell 2</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
<td>row 1, cell 2</td>
<td>row 1, cell 2</td>
</tr>
</table>
</div>
</div>
我認爲這是標記爲錯誤的問題的副本。這實際上是http://stackoverflow.com/questions/11891065/css-only-scrollable-table-with-fixed-headers的副本。 – dbn