gpt4 book ai didi

javascript - Bootstrap 表特定列的最后一行

转载 作者:太空宇宙 更新时间:2023-11-04 01:53:48 26 4
gpt4 key购买 nike

我有一个看起来像这样的自定义日历:

enter image description here

正如日历上所示,我需要用特定的边框标记今天的日期。我不确定如何获取特定(今天)列中的最后一行并在其上设置 border-bottom: 1px solid red;

我的表格自定义 SCSS 代码如下所示,td 类包含 .client-today 的列的最后一行,我需要添加 border -底部:1px 纯红色;(但仅在最后)。

.calendar-table {
border-spacing: 0;
width: 100%;
table-layout: fixed;
empty-cells: show;
td {
text-align: center;
&:first-child {
text-align: left;
padding: 5px;
}
}
th {
text-align: center;
padding: 5px;
&:first-child {
width: 15%;
}
}
.today {
border-bottom: 2px solid #C22;
}
.client-today {
border-right: 2px solid #C22 !important;
border-left: 2px solid #C22 !important;
}
.checked {
border: none;
cursor: pointer;
background-color: rgba(255, 234, 234, 1);
background: linear-gradient(to bottom, rgba(255, 234, 234, 1) 0%, rgba(255, 193, 193, 1) 100%);
}
.is-switch {
border: none;
cursor: pointer;
z-index: 2;
background-color: #ffc578;
background: linear-gradient(to bottom, #ffc578 0%, #fb9d23 100%);
}
.attendant-name {
position: absolute;
top: 5px;
width: 140px;
z-index: 1;
text-align: left;
padding-left: 5px;
}
&.table-hover > tbody > tr:hover {
background-color: #f2f9fe;
background: linear-gradient(to bottom, #f2f9fe 0%, #d6f0fd 100%);
}
}
<table class="calendar-table table-bordered table-hover">
<thead>
<tr>
<th>Clients</th>
<th ng-class="{'today': day.today}" ng-repeat="day in $ctrl.days track by $index">
{{day.dateView}}
</th>
</tr>
</thead>
<tbody>
<tr dir-paginate="item in $ctrl.calendar | itemsPerPage: $ctrl.pageSize track by $index " total-items="$ctrl.totalItems">
<td>
{{item.name}}
</td>
<td style="position: relative" ng-click="$ctrl.openEvent(day)" ng-class="{ 'checked': day.checked, 'is-switch' : day.isSwitch, 'client-today': day.today }" ng-repeat="day in item.calendar track by $index">
<div ng-if="day.attendantName" class="attendant-name">{{day.attendantName}}</div>
<i ng-if="day.isSwitch" class="fa fa-car" aria-hidden="true"></i>
</td>
</tr>
</tbody>
</table>

最佳答案

您可以使用 last-child CSS 选择器。

tbody tr:last-child .client-today {
border-bottom: 1px solid red;
}

关于javascript - Bootstrap 表特定列的最后一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42954533/

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