bootstrapTable行样式设置

在这里插入图片描述
//按需求设置不同的样式:5个取值代表5中颜色[‘active’, ‘success’, ‘info’, ‘warning’, ‘danger’];

options.rowStyle = function (row, index) {
                var style = "";
                style='active';
                return { classes: style }
            };

**

隔行变色

**

  1. 对象.striped = true
    在这里插入图片描述
  2. css样式更改
table tr:nth-child(even){
        background: #ccc;
    }

在这里插入图片描述

  1. 自定义字体颜色,或者背景颜色(全文中的options是我自己这个项目定义的,不要照抄)
options.rowStyle = function (row, index) {
                var style = {};
                style={css:{'color':'#ed5565'}};
                return style;
            } ;

猜你喜欢

转载自blog.csdn.net/MTone1/article/details/85465837