Can label be in the middle of el-table?

I set width or label to the left
is there any other way to center label in this column

clipboard.png


Hello, you can set the text center of the header by setting the class, of the header by setting the header-row-class-name property.
the following is the whole code

<template>
    <div>
        <el-table :data="data" header-row-class-name="center">
          <el-table-column label="" prop="name"></el-table-column>
          <el-table-column label="" prop="age"></el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    data(){
        return{
            data: [
                {
                    name: '',
                    age: '18'
                }
            ]
        }
    }
}
</script>

<style>
.center th .cell{
    text-align: center !important;
}
</style>

: header-cell-style= "{'text-align':'center'}"


write the attribute align= "center" directly on the tag, which is for a single one. If it is all, it is recommended to use the first floor method

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e65191-45b18.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e65191-45b18.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?