【发布时间】:2018-11-22 23:48:52
【问题描述】:
我有一个简单的,我想要一个列对齐的可滚动表格。
我试过这个(来自https://stackoverflow.com/a/11483686/1599054):
<table>
<thead>
<tr><th>loooooooooooooong</th><th>headers</th></tr>
</thead>
<tbody>
<tr><td>t</td><td>t</td></tr>
<tr><td>t</td><td>t</td></tr>
<tr><td>t</td><td>t</td></tr>
</tbody> </table>
还有 CSS:
thead { display:block; background: green; margin:0px; cell-spacing:0px; left:0px; }
tbody { display:block; overflow:auto; height:100px; }
th { height:50px; }
td { height:50px; background:blue; margin:0px; cell-spacing:0px;}
你可以在这里看到它:http://jsfiddle.net/Rfgm2/1/
我的问题是我的内容小但标题大,它们是“动态”对齐它们的手段吗?
【问题讨论】:
标签: html css html-table