I've been attempting to include a border
and background-color
to my table but for some reason it's not taking effect.
This is the CSS code for my table:
table {
width: 100%;
display: grid;
overflow: auto;
}
table thead,
table tbody,
table tr {
display: contents;
}
The CSS I'm trying to apply, which isn't working, is:
tbody tr:nth-child(odd) {
border: solid 1px #e2e2e2;
background-color: #f4f4f4;
}
tbody tr:nth-child(even) {
border: solid 1px #e2e2e2;
background-color: blue;
}
I need some guidance on how to make this work because I really need that background-color
.
I also attempted to use this:
tbody tr {
background-color: blue;
}
Unfortunately, none of these options are achieving the desired result.
Thank you in advance for any help you can provide.