Vue ElementUI implements text centering in tables

The first one: el-tableadd header-cell-styleand cell-stylestyle in
<el-table :data="list"
:header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }"
></el-table>
The second type: styleadd 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>

Guess you like

Origin blog.csdn.net/sunshineTing2/article/details/128833919