当前位置: 首页 > Web前端 > HTML5

使用bootstrap-table修复表格的前4列

时间:2023-04-05 23:02:27 HTML5

1、首先导入对应的css和js:.min.css"rel="stylesheet"/>2、然后调用下面的js方法固定表的前4列并设置表的参数(该方法bootstrap-table会根据表的内容自动生成新表并覆盖),data_table为表id要引用,固定如下格式:$("#data_table").bootstrapTable('destroy').bootstrapTable({//search:true,//是否启用搜索栏toolbar:'.toolbar',//whichDOMtouseasatoolColumn//pagination:true,//是否显示分页(*)//sidePagination:"client",//分页方式:客户端分页,服务端分页(*)//pageNumber:1,//初始化并加载第一页,默认第一页//pageSize:2,//每页记录行数(*)fixedColumns:true,//是否启用固定列fixedNumber:4,//固定列height:tableheight//设置表格高度});bootstrap-table文件下载:链接:https://pan.baidu.com/s/1Un3t...提取码:yh2w