Bootstrap Table表头固定、列固定的实现
参考APIBootstrap Table>Table OptionsBootstrap Table>Column Options表格展示的两种实现方式Bootstrap Table插件通过数据属性或JavaScript以表格格式显示数据数据属性通过JavaScript表头固定数据属性使用data-heightJavaScript$('#table').bootstrapTable({h
·
参考API
表格展示的两种实现方式
Bootstrap Table插件通过数据属性或JavaScript以表格格式显示数据
表头固定
- 数据属性
使用data-height - JavaScript
$('#table').bootstrapTable({
height: 460
})
列固定
- JavaScript
里面只需要关注3个属性
- fixedColumns 默认为false禁用冻结列,设为true启用冻结列(左侧)
- fixedNumber 冻结列的个数,当fixedColumns设为true有效(左侧)
- fixedRightNumber 冻结列的个数,当fixedColumns设为true有效(右侧)
注意:需要先引入bootstrap-table-fixed-columns插件
其他
- 通过data-width和data-width-unit属性给列设置宽度
- 通过data-class属性给列指定样式
- 通过data-pagination属性设置是否显示底部工具栏
- …
更多推荐
已为社区贡献3条内容
所有评论(0)