element ui - el-table sets the header background color and font color

element ui - el-table sets the header background color and font color


Scenes

When using el-table in elementui, because the default table style does not match the design draft, the background color and font color of the table header need to be set to new colors.

But setting thead, thead tr, and .el-table__cell elements is invalid. I checked the elementui official website and found that you need to use header-cell-style attribute.

Insert image description here

code

<el-table :header-cell-style="{background:'#eef1f6',color:'#606266'}">
</el-table>

Effect

Insert image description here

Guess you like

Origin blog.csdn.net/qq_38374286/article/details/131330934