且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

数据表和不需要的水平滚动条的问题

更新时间:2021-12-16 10:06:36

是将内表的宽度设置为:

In the end the best solution was to set the width of the inner table to:

table-layout:fixed;
width: 98% !important; 

此处列出的所有解决方案都有不良的裁剪行为。以这种方式限制表格宽度也允许我动态调整表格的高度,使水平滚动条可以根据需要出现或消失,而不引入水平滚动。

All solutions listed here had undesirable cropping behavior. Limiting the table width in this way also allowed me to dynamically adjust the height of the table such that the horizontal scrollbar can appear or disappear on demand without introducing an horizontal scroll.

http://jsfiddle.net/FBpLA/15/