datatable根据条件设置表格行中字的颜色或背景

使用row回调函数

 "rowCallback": function (row, data) {
            if (xxx) {
              //给行添加背景色
                $(row).css("background", "red");
             //给行内的字添加颜色
                $(row).css("color", "red");
            }
        },

 

posted @ 2019-03-28 14:22  y-xs  阅读(4438)  评论(2编辑  收藏  举报