Dun*_*nan 10 html css twitter-bootstrap
我有一个包含大量行的表,这导致引导程序"响应表",滚动条离开屏幕底部.要查看溢出到两侧的数据,您必须滚动到底部,移动滚动条,然后再次向上滚动.
看看这个小提琴,http://jsfiddle.net/Lq4uk/1/
这是HTML代码,
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<th>#</th>
<th>Header 1</th>
... (bunch of headers)
</thead>
<tbody>
<tr>
<th>1</th>
<th>Some long text to make this overflow</th>
... (bunch of cells)
</tr>
... (lots more rows)
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
如何使水平滚动条始终可见?
或者,以不同的方式看待它,如何使用屏幕上可用的最大空间量来确定表格的垂直尺寸?
在你的 CSS 中添加这些行 -
.table-responsive {
height: 100vh;
overflow: scroll;
}
Run Code Online (Sandbox Code Playgroud)