【发布时间】:2016-11-07 05:22:43
【问题描述】:
我有一个<div class="container">,里面有<table class="table">,看起来不错。直到单元格变宽,表格才会扩展到内容的完整大小。
<div class="container">
<table class="table">
<tr>
<td>Caption</td>
<td>Some very long string that makes the contents to overflow, actually mich like this actual example in StackOverflow.
</td>
</tr>
</table>
</div>
当内容比容器宽时,我希望有一个水平滚动条(实际上就像 StackOverflow 一样......)。
我该怎么做?在<td> 上添加style="overflow-x: scroll" 没有任何作用。
【问题讨论】:
-
溢出属性不能应用到表中。详情请看这篇帖子stackoverflow.com/questions/1211309/overflowscroll-in-td