【发布时间】:2021-11-10 02:01:28
【问题描述】:
我正在尝试将border 和background-color 添加到我的表中,但没有得到应用。
我的表格的 CSS :-
table {
width: 100%;
display: grid;
overflow: auto;
}
table thead,
table tbody,
table tr {
display: contents;
}
尝试应用的 CSS 不起作用
tbody tr:nth-child(odd) {
border: solid 1px #e2e2e2;
background-color: #f4f4f4;
}
tbody tr:nth-child(even) {
border: solid 1px #e2e2e2;
background-color: blue;
}
请给我一个出路,因为我需要申请background-color。
我也试过申请。
tbody tr {
background-color: blue;
}
这也不行。
提前致谢。
【问题讨论】:
-
能不能给我们看一下表格的html
标签: css bootstrap-4 sass react-bootstrap