使用bootstrapTable绑定表格数据时,如何在bootstrapTable绑定数据的表格中设置某个单元格的样式。
需要使用到bootstrapTable中cellStyle进行设置,在bootstrapTable绑定数据中在对应的columns里面添加cellStyle
columns: [
{ title: '学员姓名', field: 'studentName' },
{ title: '开课手机', field: 'openPhone' },
{
title: '学院', field: 'leaderCategoryCode',
formatter: function (value,row,index) {
return dicts.category[value];
},
cellStyle:function(value,row,index){
if (value=="j5m484vz" && datef.num2Date(row.createTime) >= '2019-04-08 00:00:00'){
return {css:{"color":"#9900FF"}}
}else{
return {}
}
}
}
]