css圆角表格

 

在设置完四个角的<td>标签border-radius后

设置<table>标签的border-radius无效,还是直角的情况。

修改border-collapse: collapse为separate即可。

 

 

.content .question-box .question .answer-table {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #e7e7e7;
}

.content .question-box .question .answer-table tr:last-child {
    background: #f5f5f5;
}

.content .question-box .question .answer-table th {
    font-weight: bold;
    background: #f5f5f5;
    border-right: 1px solid #e7e7e7;
    border-bottom: 1px solid #e7e7e7;
    text-align: center;
}

.content .question-box .question .answer-table td {
    border-right: 1px solid #e7e7e7;
    border-bottom: 1px solid #e7e7e7;
    height: 37px;
    box-sizing: border-box;

}

.content .question-box .question .answer-table th:first-child {
    border-radius: 10px 0 0 0;
}

.content .question-box .question .answer-table th:last-child {
    border-radius: 0 10px 0 0;
}

.content .question-box .question .answer-table tr:last-child td:first-child {
    border-radius: 0 0 0 10px;
}

.content .question-box .question .answer-table tr:last-child td:last-child {
    border-radius: 0 0 10px 0;
}

.content .question-box .question .answer-table td:last-child,.content .question-box .question .answer-table th:last-child {
    border-right: none;
}

.content .question-box .question .answer-table tr:last-child td {
    border-bottom: none;
}

 

 

 

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值