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