我有一个包含在 div 中的表格。 表布局是固定的。 div 具有 css 属性“溢出:滚动”。 但是当我改变小于表格宽度的div时, 没有出现滚动条
最佳答案
指定一定的width
,height
给DIV然后overflow:auto;
overflow:auto;
width:500px;
height:400px;
检查这段代码
<style type="text/css">
.pqr{
overflow:auto;
width:500px;
height:400px;
}
</style>
<div class="pqr">
<table width="600px" border="1">
<tr>
<td>
Test
</td>
</tr>
</table>
</div>
关于html - div 中有一个表格不滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3186409/