.html文件
<table class=\"layui-hide\" id=\"sysTable\" lay-filter=\'sysTable\'></table></div>
.js文件
var tableLists = [ //标题栏
{type:‘checkbox’,fixed: ‘left’}
, {field: ‘sort’,title:‘序号’,type: ‘numbers’,width: 80,fixed: ‘left’ ,align:‘center’}
, {field:‘code’, title:‘编码’,width:130}
]
// 选中行数据
var rowDataList = {};
// 勾选数据
var checkDataList = [];
function initTable(data) {
rowDataList = {};
checkDataList = [];
//展示已知数据
table.render({
id: ‘id1’
, elem: ‘#sysTable’
, cols: [tableLists]
, data: data
, limit: 10
})
}
请添加此css样式:
注意:表格渲染如果设置了“fixed: ‘left’”此,字段需要去掉,
.layui-table-cell {height: auto;}