I am trying to add border and background-color to my table but it's not getting applied.
CSS of my table :-
table {
width: 100%;
display: grid;
overflow: auto;
}
table thead,
table tbody,
table tr {
display: contents;
}
CSS trying to apply which is not working
tbody tr:nth-child(odd) {
border: solid 1px #e2e2e2;
background-color: #f4f4f4;
}
tbody tr:nth-child(even) {
border: solid 1px #e2e2e2;
background-color: blue;
}
Please suggest me a way out, because I need to apply the background-color.
I have also tried applying.
tbody tr {
background-color: blue;
}
This is also not working.
Thanks in advance.