总有人间一两风,填我十万八千梦

Bootstrap Table设置单元格样式 td class style

其他 Zero、J 2379℃ 0评论

设置columns中字段对应的cellStyle方法即可,代码如下所示。

$('xxx').bootstrapTable({
    columns: [
        {
            field:'id',
            title: '索引',
            formatter: function (value, row, index) {
                return index + 1;

            }, cellStyle: function (value) {
                return {
                    'classes':'xxx xxxx',   //通过class
                    'css': {                //通过style
                        'width': '48px',
                        'text-align': 'center'
                    }
                };
            }
        }
    ]
});

转载请注明:悠然品鉴 » Bootstrap Table设置单元格样式 td class style

喜欢 (1)or分享 (0)
发表我的评论
取消评论

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址