本地访问效果如下,应该是有滚动条的:
部署到tomcat后,滚动条显示短时间后自动隐藏了:
而且只在chrome浏览器中出现这种情况
浏览器问题 你要做兼容
<div style="width: 600px;height: 400px;border: 1px solid #000;overflow: hidden;">
<div style="width: 500px;height: 300px;border:1px solid green;overflow-x: scroll">
<table style="width: 900px;height: 300px;border:1px solid red;">
<thead>
<tr>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
</tr>
</thead>
</table>
</div>
</div>
html+css:
测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 |
---|
</div>
是的
你这样不行
测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 | 测试 |
---|
</div>
你可以尝试 给每个
分配一个宽度,超出部分应该能显示出滚动条,找到原因了,chrome输入chrome://flags/,把Overlay Scrollbars选项的Default设为disabled就可以了,这个应该只是chrome的一个测试的功能