我已经找了又找,但还没能找到我的需求的解决方案。
我有一个普通的旧HTML表。我希望它的圆角,没有使用图像或JS的,即纯CSS只有。如下所示:

角单元格为圆角,单元格为1px粗边框。
到目前为止,我有这样的想法:
table {
-moz-border-radius: 5px !important;
border-collapse: collapse !important;
border: none !important;
}
table th,
table td {
border: none !important
}
table th:first-child {
-moz-border-radius: 5px 0 0 0 !important;
}
table th:last-child {
-moz-border-radius: 0 5px 0 0 !important;
}
table tr:last-child td:first-child {
-moz-border-radius: 0 0 0 5px !important;
}
table tr:last-child td:last-child {
-moz-border-radius: 0 0 5px 0 !important;
}
table tr:hover td {
background-color: #ddd !important
}但这让我没有任何细胞的边界。如果我添加边框,它们不是圆角的!
有什么解决方案吗?
发布于 2017-11-29 02:22:27
表格边框中的课程...
注意:下面的HTML/CSS代码只能在IE中查看。代码将无法在Chrome中正确呈现!
我们需要记住:
CSS表格有一个边框:它的外部边界(也可以有border-radius.)
表{边框-折叠:分离;}
二、删除环绕表格角部单元格的样式规则。
三、然后玩边框间距,这样你就可以看到表格边框和单元格边框可以折叠的边框(使用: interference.
i.如果表格边框是圆角的,但单元格边框仍然是方形的,则单元格的形状优先,表格将失去其弯曲的corners.ii。相反,如果角单元格是弯曲的,但表格边界是方形的,那么您将看到一个丑陋的正方形角点,它与角点单元格的曲率相邻。
-
三、如果桌子的边角是四舍五入的,这并不重要(例如:它的边框半径可以是零)。
.zui-table-rounded {
border: 2px solid blue;
/*border-radius: 20px;*/
border-collapse: collapse;
border-spacing: 0px;
}
.zui-table-rounded thead th:first-child {
border-radius: 30px 0 0 0;
}
.zui-table-rounded thead th:last-child {
border-radius: 0 10px 0 0;
}
.zui-table-rounded tbody tr:last-child td:first-child {
border-radius: 0 0 0 10px;
}
.zui-table-rounded tbody tr:last-child td:last-child {
border-radius: 0 0 10px 0;
}
.zui-table-rounded thead th {
background-color: #CFAD70;
}
.zui-table-rounded tbody td {
border-top: solid 1px #957030;
background-color: #EED592;
} <table class="zui-table-rounded">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Height</th>
<th>Born</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>DeMarcus Cousins</td>
<td>C</td>
<td>6'11"</td>
<td>08-13-1990</td>
<td>$4,917,000</td>
</tr>
<tr>
<td>Isaiah Thomas</td>
<td>PG</td>
<td>5'9"</td>
<td>02-07-1989</td>
<td>$473,604</td>
</tr>
<tr>
<td>Ben McLemore</td>
<td>SG</td>
<td>6'5"</td>
<td>02-11-1993</td>
<td>$2,895,960</td>
</tr>
<tr>
<td>Marcus Thornton</td>
<td>SG</td>
<td>6'4"</td>
<td>05-05-1987</td>
<td>$7,000,000</td>
</tr>
<tr>
<td>Jason Thompson</td>
<td>PF</td>
<td>6'11"</td>
<td>06-21-1986</td>
<td>$3,001,000</td>
</tr>
</tbody>
</table>
https://stackoverflow.com/questions/4932181
复制相似问题