先看效果圖-表頭背景顏色高度? 自定義
<!-- 表頭樣式 顏色及高度 表格數(shù)據(jù)-->
<el-table :data="tableData" style="width: 100%"
:header-cell-style="{ background: '#74E77F',padding: '0',borderTop: '1px solid #eaeaea',fontSize:'12px',color:'#808080'}"
:header-row-style="{height:'36px'}"
:row-style="{height:'37px',fontSize:'12px', background: '#17B3A3'}">
<!-- 在這里 ??表的 每個子項 顏色及高度 且必須加下面 樣式代碼--去掉默認樣式用的>
<!-- 忽略-->
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="empName" label="用戶名稱">
</el-table-column>
</el-table>
樣式代碼-----別想著加? !important? ? 我也試了不行
如果style 用了??:<style lang="scss">
/* 注意此處不能有scoped 否則樣式無法生效 */? ? ? ? ??文章來源:http://www.zghlxwxcb.cn/news/detail-610212.html
那么去掉 ::v-deep 即可正常使用文章來源地址http://www.zghlxwxcb.cn/news/detail-610212.html
::v-deep.el-table--medium .el-table__cell {
padding: 0px 0;
}
到了這里,關于Vue修改element-admin UI <el-table> tr 表-子項的高度 及背景顏色的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!