table标签设置圆角效果

在使用有border的table时发现设置圆角无效;经过万能的度娘后查到:当 border-collapse 的值为 collapse 时,border-radius 属性不会被应用到表格
因此只能换种方式实现;下边是scss代码

#display-func-tab {
    border-collapse: separate;
    border-spacing: 0;
    th,
    td {
      height: 68px;
      border: 1px solid #e4e4e4;
      font-size: 14px;
    }
    thead {
      tr {
        height: 47px;
        color: rgba(0, 0, 0, 0.6);
        background: #f6f6f6;
        text-align: center;
        & > th:first-child {
          border-top-left-radius: 10px;
          border-bottom: 0;
          border-right: 0;
        }
        & > th:last-child {
          border-top-right-radius: 10px;
          border-bottom: 0;
        }
      }
    }
    tbody {
      tr {
        td {
          &:first-child {
            border-right: 0;
            text-align: center;
            font-weight: 600;
            color: #232427;
          }
          &:nth-child(2) {
            text-indent: 50px;
            color: #232427;
            &.highlight-point {
              position: relative;
              &::before {
                position: absolute;
                left: -20px;
                top: 50%;
                transform: translateY(-50%);
                content: "*";
                color: #e92626;
                font-weight: bold;
                font-size: 20px;
              }
            }
          }
        }
        &:nth-child(even) {
          background: #fcfcfc;
        }

        &:last-child {
          td:first-child {
            border-bottom-left-radius: 10px;
          }
          td:last-child {
            border-bottom-right-radius: 10px;
          }
        }
        &:not(:last-child) {
          td {
            border-bottom: 0;
          }
        }
      }
    }
  }

效果图


image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 引用CSS方式 内部引用 html文件中写一个 标签,并将样式写入到里面,举例: 外部引用 通过 标签实现,里面有...
    dawsonenjoy阅读 619评论 0 0
  • 很简单每一个元素都是一个盒子,从里到外分别为 content 内容 margin 外边距 border 边框 pa...
    klpalace阅读 212评论 0 1
  • 用TCP协议发送时,由于TCP是数据流协议,因此不存在包大小的限制(暂不考虑缓冲区的大小) HTTP/2 头压缩算...
    JLong阅读 558评论 0 0
  • 很早之前就在看web前端面试题,一直想总结一个比较全面又详细的面试题库,现在总结了一些,分享给大家,以后还会持续更...
    樱桃小丸子儿阅读 86,517评论 32 691
  • # 内容概述 ## 一. css特性 + 继承 + 层叠 ### 1. CSS属性的继承 CSS中有些属性是可继承...
    Autism_8eaf阅读 134评论 0 0

友情链接更多精彩内容