将滚动添加到表格 [英] Add scroll to a table
本文介绍了将滚动添加到表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个表格,我动态地添加行,并且当宽度达到300或更多时,我想为表格添加垂直滚动。任何提示?
I have a table in which i add rows dynamically and i want to add a vertically scroll to the table when its width get 300 or more. Any tips?
推荐答案
您可以将表格封装在< div>
与 overflow:auto
样式,如下所示:
You can wrap your table in a <div>
with the overflow: auto
style, as follows:
<div style="overflow: auto; width: 300px; height: 300px;">
<table>
</table>
</div>
这篇关于将滚动添加到表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文