element-ui中table表格表头和表格内容都水平居中,以及斑马纹背景颜色修改


<el-table
   :data="detalData"
   stripe  //斑马纹
   border
   :header-cell-style="{textAlign: 'center'}"   // 表头水平居中
  :cell-style="{ textAlign: 'center' }"       //表格内容水平居中
   style="width: 100%">
     <el-table-column
        prop="date"
        label="序号"
     >
   </el-table-column>
</el-table>

二. 斑马纹的设置

::v-deep .el-table .el-table__body tr.el-table__row td{
  background: rgba(79, 218, 255, 0.18000000715255737);
}
::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td{
  background: rgba(79, 218, 255, 0.05000000074505806);
}

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM