使用的layui.table
帮忙看一下为什么我的列对不齐:
```javascript
table.render({
elem: '#add'
,id: 'tab2'
// , height: ''
, url: 'views/pda/Cld_SltJson_wj'
, where: { where: "", order: "FBILLNO",name:"V_PoorderCount",page:page+1}
// ,height: alarmTableContainer.height() - 16
, totalRow: false
, cols: [[ //标题栏
{ field: 'FBillNo', minWidth: 100, title: '订单编号', align: 'center' }
, { field: 'FDate', minWidth: 100, title: '订单日期', align: 'center' }
, { field: 'FCustName', minWidth: 120, title: '供应商', align: 'center' }
, { field: 'FMaterialNumber', minWidth: 200, title: '物料编码', align: 'center' }
, { field: 'FMaterialName', minWidth: 80, title: '物料名称', align: 'center' }
, { field: 'FMaterialModel', minWidth: 80, title: '规格型号', align: 'center' }
, { field: 'FQty', minWidth: 80, title: '订货数量', align: 'center' }
, { field: 'FProdDate', minWidth: 80, title: '订单交货日期', align: 'center' }
, { field: 'FInStockQty', minWidth: 80, title: '收料数量', align: 'center' }
, { field: 'FStockQty', minWidth: 80, title: '入库数量', align: 'center' }
, { field: 'FOutStockQty', minWidth: 100, title: '剩余入库数量', align: 'center' }
]]
, skin: 'row' //表格风格
, even: true
, size: 'md'
, page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
layout: ['limit', 'count', 'prev', 'page', 'next'] //自定义分页布局
}
, limit: 3 //每页默认显示的数量
// , limits: [200, 500]
, page: false
, done: function (res, curr, count) {
//定位当前table视图
var that = this.elem.next();
res.data.forEach(function (item, index) {
// 所需的条件
if (item.FColour == 1) { //1=黑色
that.find('tbody tr[data-index="' + index + '"]')
.css('background-color', '#070707') //背景颜色
.css('color', '#f7faf6') //字体颜色
.css('border', '1px solid #FFF'); //边框
} else if (item.FSEQ <= 1) {//2=红色
that.find('tbody tr[data-index="' + index + '"]').css('background-color', '#f60303').css('color', '#070707').css('border', '1px solid #FFF');
} else if (item.FSEQ <= 3 && item.FSEQ > 1) {//3=黄色
that.find('tbody tr[data-index="' + index + '"]').css('background-color', '#f8f804').css('color', '#0b0b0b').css('border', '1px solid #FFF');
} else if (item.FColour == 4) {//4=绿色
that.find('tbody tr[data-index="' + index + '"]').css('background-color', '#2df804').css('color', '#0b0b0b').css('border', '1px solid #FFF');
} else {
that.find('tbody tr[data-index="' + index + '"]').css('background-color', '#f7faf6').css('color', '#101010').css('border', '1px solid #070707');
}
});
//response.data获取后端返回的JSON格式数据
$.each(res.data, function (index, item) {
})
//数据渲染完的回调
}
})