当前位置:   article > 正文

element-ui中el-table表格的表头和表格内容居中显示_列头居中

列头居中

在这里插入图片描述

这是让整个表格和内容居中的方式:header-cell-style设置头部居中;cell-style设置单元格内容居中
 <el-table
          :data="tableData"
          style="width: 100%;"
          :height="bodyHeight - 172"
          :header-cell-style="{'text-align':'center'}"
          :cell-style="{'text-align':'center'}"
 >
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
如果想让单个表格的内容居中:只需要在el-table-column上加上align=‘center’
 <el-table-column label="招聘人数" prop="require_num" min-width="150"  align='center'>
 </el-table-column>
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/686691
推荐阅读
相关标签
  

闽ICP备14008679号