Create diagonal border of a cell

后端 未结 4 1363
渐次进展
渐次进展 2021-02-06 01:26

I wonder if it is even possible creating a table with diagonal border line using css or jquery just like below:

\"en

4条回答
  •  猫巷女王i
    2021-02-06 02:29

    here's an example in table with border and diagonal in css https://codepen.io/halimarm/pen/rNaPyGR?editors=1100

    table {
      width: 100%;
    }
    
    table td {
      position: relative;
      overflow: hidden;
      border: 1px solid #000;
    }
    
    .line {
      position: absolute;
      height: 40px;
      top: 40px;
      bottom: 0;
      margin: auto;
      left: -5px;
      width: 100%;
      border-top: 1px solid #000;
      -webkit-transform: rotate(14deg);
      -ms-transform: rotate(14deg);
      transform: rotate(14deg); 
    }
    
    .diagonal {
      width: 150px;
      height: 40px;
    }
    .diagonal span.lb {
      position: absolute;
      bottom: 2px;
      left: 2px;
    }
    .diagonal span.rt {
      position: absolute;
      top: 2px;
      right: 2px;
    }
    abc abc Rata - Rata Total
    abc abc abc
    abc abc abc

提交回复
热议问题