官方文档中 el-table-column 可以使用 class-name 属性绑定 css class ,但实测此方法无效,要想达到操纵指定单元格样式的目的,需使用 el-table 的 cell-style 回调方法动态绑定;
例:将前三列单元格的垂直对齐指定为垂直居上
<el-table
border stripe
:cell-style="cellStyle">
</el-table>
methods: {
cellStyle({row, column, rowIndex, columnIndex}) {
if (columnIndex <= 3) {
return {
'vertical-align': 'top',
'text-align': 'center'
}
}
}
},

3168

被折叠的 条评论
为什么被折叠?



