Layui设置数据表格自适应列宽

在这里插入图片描述

主要代码
cols: [[
{field:‘theDate’, width:‘10%’, title: ‘提货日期’,align:‘center’,unresize:true}
,{field:‘goodsId’, width:‘10%’, title: ‘商品Id’, align:‘center’}
,{field:‘goodsName’, width:‘30%’, title: ‘商品名称’, align:‘center’}
,{field:‘lineName’, width:‘10%’, title: ‘线路’, align:‘center’}
,{field:‘tranName’, width:‘10%’, title: ‘服务站’, align:‘center’}
,{field:‘wareHouse’, width:‘10%’, title: ‘所属仓库’, align:‘center’}
,{field:‘factSaleNum’, width:‘10%’, title: ‘实际销售数量’, align:‘center’}
,{field:‘returnNum’, width:‘10%’,title: ‘退货数量’, align:‘center’}
]],
done: function (res, curr, count){
$(“table”).css(“width”, “100%”);
//这里设置表格的宽度为100%
},


版权声明:本文为qq_41050983原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。