layui表格中给对应的列加背景色
直接在style加样式即可,里面的status跟列的field对应上,data-content是field的值。
<style>
td[data-field=status][data-content=NONE] {
background-color: #bdc2c3;
}
td[data-field=status][data-content=ING] {
background-color: #1c84c6;
color: white;
}
td[data-field=status][data-content=DONE] {
background-color: #1ab394;
color: white;
}
</style>
结果如下: