Bootstrap

el-table表头添加斜线

通过css添加伪类
在这里插入图片描述

  <el-table :data="tableData" border>
                        <el-table-column align="right" width="150" prop="countType">
                            <template slot="header" slot-scope="scope">
                                <div style="width: 100%">
                                    <div class="title1">职业技能</div>
                                    <div class="title2">人数</div>
                                    <div class="title3">统计类型</div>
                                </div>
                            </template>
                        </el-table-column>
                         </el-table>
.title1:before {
    content: '';
    position: absolute;
    width: 1px;
    /*这里需要自己调整,根据td的宽度和高度*/
    height: 180px;
    top: 0;
    left: 0;
    background-color: grey;
    opacity: 0.3;
    display: block;
    transform: rotate(-74deg);
    transform-origin: top;
    /*这里需要自己调整,根据线的位置*/
}
.title1 {
    display: block;
}
.title2 {
    padding-right: 14px;
    display: block;
}

.title3 {
    text-align: left;
    display: block;
}

.title3:before {
    content: '';
    position: absolute;
    width: 1px;
    /*这里需要自己调整,根据td的宽度和高度*/
    height: 180px;
    top: 1px;
    left: 0;
    background-color: grey;
    opacity: 0.3;
    display: block;
    transform: rotate(-51deg);
    transform-origin: top;
    /*这里需要自己调整,根据线的位置*/
}
;