css - 在 td 内滚动一个 div

标签 css

我想滚动第二个单元格中的 div。但它就是行不通! (在 Chrome 中试过)。有任何想法吗?提前致谢!

<style>
body{height:100%;overflow:hidden;}
</style>

<table width=100%>
<tr>
    <td id="menu">
        <div>
        ... 
        </div>
    </td>

    <td id="list">
        <div style="overflow:auto;">
        ... 
        </div>
    </td>

    <td id="details">
        <div>
        ...
        </div>
    </td>
</tr>
</table>

最佳答案

没有滚动的原因是单元格的高度与 DIV 容器一起自动调整。一切都需要设置高度才能滚动工作。请参阅我在下面制作的示例。

http://jsfiddle.net/QJW7w/

关于css - 在 td 内滚动一个 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8584088/

相关文章:

javascript - 在 html 中显示来自 foreach 循环的 5 个结果

html - 滚动到页面顶部和底部后如何防止空白 "bounce"

css - 绝对定位的伪元素与父元素一起滚动

html - 将 div 定位在中心但具有动态高度?

html - 垂直居中具有行高的各种大小的跨度

html - Img 设置为最大宽度 : 100% is publishing larger than the actual image size?

html - 当flex-direction为column时,div会占据所有可用宽度。如何防止这种情况?

css - 如何在 DIV 中对齐按钮

html - 将 <h1> 标签放在 Angular 落

css - 如何用另一个 <div> 覆盖 <div> 的边框?