【发布时间】:2017-04-13 07:45:41
【问题描述】:
<div class="service-table">
<table class="table">
<thead>
<th>Title</th>
<th>Title</th>
</thead>
<tbody>
<tr>
<td>Text</td>
<td>Text</td>
</tr>
</tbody>
</table>
</div>
我有一张带有这个 Bootstrap 类的表。这是我的 div CSS:
.service-table {
height: 100px;
overflow: auto;
text-align: center;
}
如果表格高度高于 100 像素,我正在尝试修复高度并显示滚动条。在其他浏览器的桌面或移动设备上很好(在桌面 Chrome 上也很好)。但在移动 Chrome 上,滚动条没有出现,所以高度不是 100px。
【问题讨论】:
-
我在您的表格中添加了更多行,使其高度超过 100 像素,并且按预期工作:jsbin.com/rarayurina/edit?html,css,output
-
我会在手机上测试谢谢 :)
-
在我的手机上工作。在这里测试全屏:output.jsbin.com/rarayurina/quiet
-
我在其他手机上的 chrome 上测试过,如果你添加这个评论来回答,我可以检查一下,谢谢 :)