【发布时间】:2021-03-22 02:12:47
【问题描述】:
如果我在表格标签上有边框折叠属性,我的边框半径不会显示。我需要打开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 {
font-weight: 600;
}
<table>
<tbody>
<tr>
<td>Application</td>
<td>Natural gas & LPG</td>
</tr>
<tr>
<td>Standards</td>
<td>BS EN ISO 9001:2008 - EN 331:1998</td>
</tr>
<tr>
<td>Connection</td>
<td>BSP Taper F</td>
</tr>
<tr>
<td>Finish</td>
<td>Plated</td>
</tr>
</tbody>
</table>
非常
【问题讨论】:
-
我假设您的意图是删除边框和内部内容之间的任何空间,是的,并且边框上还有一个半径?
标签: html css html-table border border-radius