gpt4 book ai didi

css - 将 Bootstrap 的表条纹行更改为每隔几行?

转载 作者:行者123 更新时间:2023-12-02 05:48:01 25 4
gpt4 key购买 nike

我想稍微修改一下 Bootstrap ,以便我的条纹行就是这样。

第 1 行和第 2 行共享相同的行背景颜色,第 3 行和第 4 行共享相同的背景颜色,第 5 行和第 6 行共享与第 1 行和第 2 行相同的背景颜色。是否有快速破解/技巧来完成某事这种?

这是我到目前为止的代码。

<table class="table table-striped table-sm">
<thead class="thead-default">
<tr>
<td>Column 1</td><td>Column 2</td>
</tr>
</thead>
<tbody>
<template ngFor let-loop [ngForOf]="model | async">
<tr>
<td>Column Data</td><td>Column Data</td>
</tr>
<tr>
<td>Column Data</td><td>Column Data</td>
</tr>
</template>
</tbody>
</table>

最佳答案

.yourTableClass tr:nth-child(4n+1), .yourTableClass tr:nth-child(4n+2) {
background: pink;
}

关于css - 将 Bootstrap 的表条纹行更改为每隔几行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42701568/

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