elementUI 表格设置表头样式

eader-row-class-name 表头行的 className 的回调方法,也可以使用字符串为所有表头行设置一个固定的 className。 Function({row, rowIndex})/String
header-row-style 表头行的 style 的回调方法,也可以使用一个固定的 Object 为所有表头行设置一样的 Style。 Function({row, rowIndex})/Object
header-cell-class-name 表头单元格的 className 的回调方法,也可以使用字符串为所有表头单元格设置一个固定的 className。 Function({row, column, rowIndex, columnIndex})/String
header-cell-style 表头单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有表头单元格设置一样的 Style。 Function({row, column, rowIndex, columnIndex})/Object

 

 

其它几种写法不清楚,最后一种测试成功


<el-table :data="logs" style="width: 100%" stripe height="calc(100% - 60px)" @sort-change="sortChange" :header-cell-style="{
'background-color': '#fafafa',
'color': 'rgb(103, 194, 58)',
'border-bottom': '1px rgb(103, 194, 58) solid'
}">
... 
</el-table>

效果如下,虽然比较丑,但实现跟内容区分

 

posted @ 2018-08-31 10:33  吃饭睡觉打逗逗  阅读(36822)  评论(0编辑  收藏  举报