bootstrapTable 设置行样式

1、设置字体颜色

function rowStyle(row, index) {
    var style = {};            
    style={css:{'color':'#ed5565'}};               
    return style;
}

2、设置行背景颜色

function rowStyle(row, index) {
    var style = {};
    style = {css:{'background-color':'#ed5565'}};
    return style;
}

注意:

需要在初始化表的时候增加rowStyle  属性

$('#TableId').bootstrapTable({
            rowStyle: rowStyle,//通过自定义函数设置行样式
})

 

posted @ 2021-08-04 10:22  唏嘘-  阅读(868)  评论(0编辑  收藏  举报