element更改表格表头、行、指定单元格样式
生活随笔
收集整理的這篇文章主要介紹了
element更改表格表头、行、指定单元格样式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
element更改表格表頭、行、指定單元格樣式
更改表格的樣式
使用header-cell-style屬性,可為函數或對象
2.對象寫法
<!-- html --> <el-table :header-cell-style="{background:'red'}"></el-table>更改表格中某個單元格的樣式
1.函數寫法
<!-- html --> <el-table :header-cell-style="cellStyle"></el-table> //在method里面寫上方法 cellStyle({row, column, rowIndex, columnIndex}){if(rowIndex === 1 && columnIndex === 2){ //指定坐標return 'background:pink'}else{return ''} }2.對象寫法
<!-- html --> <el-table :cell-style="{background:'pink'}"></el-table>總結
以上是生活随笔為你收集整理的element更改表格表头、行、指定单元格样式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于elementui的input的二次
- 下一篇: Windows Server 2016