gpt4 book ai didi

html - 圆 table Angular 仅 CSS

转载 作者:技术小花猫 更新时间:2023-10-29 11:30:40 25 4
gpt4 key购买 nike

我搜索了又搜索,但未能找到满足我要求的解决方案。

我有一个普通的 HTML 表格。我想要圆 Angular ,使用图像或 JS,即纯 仅 CSS。像这样:

Table layout sketch

Angular 单元格的圆 Angular 和单元格的 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
}

但这让我的单元格没有任何边界。如果我添加边框,它们不会变圆!

有什么解决办法吗?

最佳答案

似乎在带有单独边框的 FF 和 Chrome(尚未测试任何其他)中工作正常:http://jsfiddle.net/7veZQ/3/

编辑:这是草图的一个相对简洁的实现:

table {
border-collapse:separate;
border:solid black 1px;
border-radius:6px;
}

td, th {
border-left:solid black 1px;
border-top:solid black 1px;
}

th {
background-color: blue;
border-top: none;
}

td:first-child, th:first-child {
border-left: none;
}
<table>
<thead>
<tr>
<th>blah</th>
<th>fwee</th>
<th>spoon</th>
</tr>
</thead>
<tr>
<td>blah</td>
<td>fwee</td>
<td>spoon</td>
</tr>
<tr>
<td>blah</td>
<td>fwee</td>
<td>spoon</td>
</tr>
</table>

http://jsfiddle.net/MuZzz/3577/

关于html - 圆 table Angular 仅 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4932181/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com