问题如图:
解决方法:
①一点点设置各个field对应的width,缺点:麻烦,优点:样式可根据自己需要调整,完美。
cols: [
[
{field: 'id', title: 'ID', width: '5%',hide:true,align:'center'},
{field: 'name', width: '150', title: '监控名称',align:'center'},
{ fixed: 'right', align: 'center', width: 280, title: '操作', toolbar: '#barTool' }
]
],
②直接在回调函数done中加入一段代码即可自动补全空白,优点:快速有效,缺点:样式可能不尽人意。
,done: function (res, curr, count) {
$("table").css("width","100%");
}