The first one: el-table
add header-cell-style
and cell-style
style in
<el-table :data="list"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }"
></el-table>
The second type: style
add CSS style in
<style lang="scss" scoped>
::v-deep .el-table th > .cell {
text-align: center;
}
::v-deep .el-table .cell {
text-align: center;
}
</style>