300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > html td圆角边框 解决table边框圆角无效

html td圆角边框 解决table边框圆角无效

时间:2024-02-27 08:45:22

相关推荐

html td圆角边框 解决table边框圆角无效

在table中设置border-radius发现不起作用,网上查找了一番,原因是border-collapse:collapse和border-radius不兼容。

css:

border-collapse: separate;

border-spacing: 0;

设计图效果

代码实现效果:

#table_wrap > table {

font-size: 16px;

text-align: center;

margin: 0 auto;

border-collapse: separate;

border-spacing: 0;

border: 2px #000;

}

table thead tr,table tbody tr {

height: 50px;

line-height: 50px;

/*background-color: pink;*/

}

table tr th:first-child,table tr td:first-child {/*设置table左边边框*/

border-left: 2px solid #eaeaea;

}

table tr th:last-child,table tr td:last-child {/*设置table右边边框*/

border-right: 2px solid #eaeaea;

}

table tr td:first-child,

table tr td:nth-child(2),

table tr td:nth-child(3),

table tr td:last-child{/*设置table表格每列底部边框*/

border-bottom: 2px solid #eaeaea;

}

/*table tr:last-child td:first-child,

table tr:last-child td:nth-child(2),

table tr:last-child td:nth-child(3),

table tr:last-child td:last-child{/!*设置table表格最后一列底部边框*!/

border-bottom: 2px solid #000;

}*/

table tr th {

background: #eaeaea;

}

table tr:first-child th:first-child {

border-top-left-radius: 12px;

}

table tr:first-child th:last-child {

border-top-right-radius: 12px;

}

table tr:last-child td:first-child {

border-bottom-left-radius: 12px;

}

table tr:last-child td:last-child {

border-bottom-right-radius: 12px;

}

头部1头部2头部3头部4

1内容11内容21内容31内容42内容12内容22内容32内容43内容13内容23内容33内容4

原文:/linqingvoe/p/10921414.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。