如果我在表格标签上具有边框折叠属性,则我的边框半径不会显示。我需要打开 border-radius 属性,如果删除 border-collapse 属性,我就看不到我想要的外观,即灰色部分到达表格的最边缘。
解决这个问题的方法是什么?其原因是什么?
提前致谢
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
table {
/*if i comment out the border-collapse property it then shows my radius*/
border-collapse: collapse;
margin: 25px 0;
width: 50%;
border-radius: 5px;
font-size: 1.4rem;
min-width: 400px;
border: 1px solid #c3c3c3;
/*margin is just for demo*/
margin: 20px 20px;
}
table tr {
border-bottom: solid 1px #d1d1d1;
}
table tr:nth-child(odd) {
background-color: #eee;
}
table td {
padding: 10px 15px;
}
table td:first-of-type { …Run Code Online (Sandbox Code Playgroud)