就是这个样子:
不论滚动条再怎么滚,表头始终不动。
处理起来很简单,但网上总有人瞎bb,我也是费了好大劲,终于好了。
<div class="panel-footer" style="overflow: auto;">
<table id="dataTable" class="table text-nowrap" ></table>
</div>
这是我的表:
在初始化的时候,加一个height属性就可以,相信我,试试就知道:
function getTableOptions()
{
var tableOptions = {
url: hostBase + '/selectRecordByTime',
method: 'POST', //请求方式(*)
//toolbar: '#toolbar', //工具按钮用哪个容器
height:680, //就是这里,加上就可以固定表头
sortOrder: "asc", //排序方式
大功告成,激动