如何在页眉单元格中加入边距,在tbody
中加入四舍五入
我的HTML
。
<table class="table table-hover table-comparison nobottommargin">
<thead>
<tr>
<th> </th>
<th >Starter</th>
<th>Professional</th>
<th>Business</th>
<th>Business</th>
</tr>
</thead>
<tbody>
<tr>
<td>Space</td>
<td>1 GB</td>
<td>5 GB</td>
<td>20 GB</td>
<td>20 GB</td>
</tr>
</tbody>
</table>
这就是我想要实现的目标。
发布于 2021-01-18 14:39:46
我将使用以下css规则:
thead th {
background-color: blue;
display: inline-block;
margin: 0 20px;
padding: 5px;
border-radius: 10px;
}
发布于 2021-01-18 15:45:35
它可以做到这一点
table{
border-spacing: 10px;
}
thead th:not(:first-child){
background-color: #058ba2;
padding: 5px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
color:white;
}
发布于 2021-01-18 14:32:55
你可以这样做:
.table thead tr th:not(:first-child),
.table tbody tr td:not(:first-child){
padding-left: 20px;
}
:not选择器阻止第一列将左填充设置为20px。我假设您希望将上角留为“空白”。
https://stackoverflow.com/questions/65776384
复制