首页 > 其他分享 >el-table表头斜线

el-table表头斜线

时间:2022-11-18 10:46:09浏览次数:33  
标签:el right 斜线 表头 table left

在做项目是接到一个需求,表头第一个单元格斜线分割,效果如下图

 

 刚开始把我弄得有点懵,然后去element官网看了看文档,发现el-table支持自定义表头,那问题就好解决了,直接上代码

注意el-table列宽是自适应,当宽度不一致时会导致斜线位置不对,解决办法就是给需要的列添加width

HTML部分

<el-table v-if="type !== 'class'" :data="data" border :header-cell-class-name="headerStyle">
            <el-table-column prop="name" width="200">
                <template slot="header">
                    <div class="right">
                        学科
                    </div>
                    <div class="left">
                        {{ type === 'area' ? '学校名称' : '班级名称' }}
                    </div>
                </template>
            </el-table-column>
</el-table>

css部分

.left {
    text-align: left;
    position: relative;
    padding-left: 10px;
}

.left::after {
    content: '';
    width: 100%;
    height: 0px;
    position: absolute;
    border-bottom: 1px solid $--theme-color;
    top: 0;
    left: 0;
    transform: rotate(12deg);
}

.right {
    text-align: right;
    padding-right: 10px;
}

效果

 

标签:el,right,斜线,表头,table,left
From: https://www.cnblogs.com/cstd/p/16902412.html

相关文章

  • excel表格多列数据中查找重复行数据
    1、做透视表统计2、设置显示格式3、取消分类汇总4、拷贝到原数据后面5、排序......
  • Selenium的使用,安装chromedriver
    注意chrome和ChromeDriver版本对应1、安装32位电脑版chrome默认路径"C:\ProgramFiles(x86)\Google\Chrome\Application\chrome.exe"2、下载好的chromedriver.exe直接拷......
  • C# Http请求 POST 和 GET 和 DELETE 方式
    客户端的HTTP的请求方式一般分为四种:GET、POST、PUT、DELETE,这四种请求方式有什么不同呢。简单的说,GET就是获取资源,POST就是创建资源,PUT就是更新资源,DELETE就是删除资源......
  • C#处理Excel,读取
    Microsoft.Office.Interop.Excel.Applicationapp=newMicrosoft.Office.Interop.Excel.Application();Workbookswbks=app.Workbooks;......
  • vue elementui Switch组件添加开关样式
      /deep/.el-switch{   &::before{    content:'开';    display:none;    color:#fff;    z-index:1;  ......
  • Mysql : 出现Table ‘./mysql/proc’ is marked as crashed and should be repaired
    今天升级脚本出现的问题:Table‘./mysql/proc’ismarkedascrashedandshouldberepaired一般这种表崩溃的问题出现在mysql异常停止,或者使用kill-9命令强行杀掉进......
  • ELK8.5的搭建
    nodejs安装包http://nodejs.cn/download/可视化管理工具---Elasticsearch-headhttps://github.com/mobz/elasticsearch-head/archive/refs/tags/v5.0.0.tar.gzElast......
  • SelectSortDoWhile
    packagecom.challenger;importcom.challenger.Util;publicclassSelectSortDoWhile{   publicstaticvoidmain(String[]args)   {       //define......
  • SelectSortWhile
    publicclassSelectSortWhile{   publicstaticvoidmain(String[]args)   {       //definearray       int[]arr={5,8,2,3,7,4,10,6,9,1};......
  • Linux网络编程 I/O多路复用——select和poll
    0.I/O多路复用所谓I/O就是对socket提供的内存缓冲区的写入和读出。多路复用就是指程序能同时监听多个文件描述符。 之前的学习中写了多进程和多线程版的简单服务器模......