Den*_*ret 37
是的,你可以这样做.
最简单的方法是在你的单元格内放一个div来填充它并设置它的overflow样式属性.
CSS:
div.scrollable {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: auto;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<td><div class=scrollable>
Some content with a scrollbar if it's too big for the cell
</div></td>
Run Code Online (Sandbox Code Playgroud)
如果您希望滚动条始终可见,即使未裁剪内容auto,请scroll在CSS中替换.
Par*_*rag 12
<table width ="400" >
<tr>
<td >
<div style="width:100%; max-height:300px; overflow:auto">Your content here
</div>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助
小智 5
您应该需要提供 div 元素的“高度”或“宽度”,以便它相应地滚动。例如,您想应用垂直滚动(Y 轴):-
<td><div class="scrollable">
Some content with a scrollbar if it's not fit in your customized container
</div></td>
div.scrollable
{
width:100%;
height: 100px;
margin: 0;
padding: 0;
overflow-y: scroll
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
69449 次 |
| 最近记录: |