【发布时间】:2020-04-08 16:38:42
【问题描述】:
我制作了一个带有列标题作为选项卡的 HTML 表格。我想将border-radius 应用于两侧的表格行。但是我不知道具体怎么申请。虽然我试过了,但它根本没有用。我在每行之间也有白色空间,也使用白色边框。我还为每一行应用了蓝色左边框。我想弯曲它的顶角和底角。并且还想在行的右侧应用圆角。
其实这是我想要达到的目标:
左侧
右侧
此外,当您放大网页时,左手的蓝色边框会相互接触。为什么?在正常情况下,它很好。
#tbstud {
width:700px;
margin:50px auto;
border-collapse:collapse;
}
.column_heading {
background-color:#d9e5f0;
border-left:1px solid #ffffff;
border-radius:5px 5px 0 0;
color:#000;
font-weight:bold;
height:20px;
line-height:20px;
padding:10px;
text-align:center;
}
.customer_row td {
padding:15px;
border-left:1px solid #ffffff;
}
.customer_row {
background-color:#f5f7f9;
border-bottom:1px solid #e5e9ee;
border-left:3px solid #2585fe;
border-top:2px solid #fff;
color:#545454;
border-radius:5px;
}
#tbstud .customer_row:nth-child(2) {
border-top:none;
}
#tbstud .customer_row:last-child {
border-bottom:none;
}
<table id="tbstud">
<tr>
<th>Sr. No.</th>
<th class="column_heading">Roll No.</th>
<th class="column_heading">Name</th>
<th class="column_heading">Class</th>
<th class="column_heading">Address</th>
</tr>
<tr class="customer_row">
<td>1</td>
<td>101</td>
<td>Sam</td>
<td>MSc</td>
<td>Delhi</td>
</tr>
<tr class="customer_row">
<td>2</td>
<td>102</td>
<td>Amit</td>
<td>BCA</td>
<td>Mumbai</td>
</tr>
<tr class="customer_row">
<td>3</td>
<td>103</td>
<td>Rahul</td>
<td>BCA</td>
<td>Delhi</td>
</tr>
<tr class="customer_row">
<td>4</td>
<td>104</td>
<td>Neha</td>
<td>BA</td>
<td>Pune</td>
</tr>
<tr class="customer_row">
<td>5</td>
<td>105</td>
<td>Pooja</td>
<td>B.Tech.</td>
<td>Chandigarh</td>
</tr>
</table>
【问题讨论】: