表格hover效果:
在头部样式
[HTML] syntaxhighlighter_viewsource syntaxhighlighter_copycode .layui-table-hover {
background-color: deepskyblue !important;
}
.myTableCrossColor {
background-color: #D1EEEE;
}
表格加载后
[HTML] syntaxhighlighter_viewsource syntaxhighlighter_copycode done: function (res, curr, count) {
var that = this.elem.next();
if (res.data.length == 0) {
return;
}
res.data.forEach(function (item, index) {
if (index % 3 == 0) {
var tr = that.find(".layui-table-box tbody tr[data-index='" + index + "']").addClass("myTableCrossColor");
} else {
//var tr = that.find(".layui-table-box tbody tr[data-index='" + index + "']").css("background-color", 'white');
}
})
} |