I am trying to write CSS to change the background color of alternate rows in a table.
This CSS is ignored.
Other ideas?
.table-row:nth-child(even) {
background: gray !important;
}
I am trying to write CSS to change the background color of alternate rows in a table.
This CSS is ignored.
Other ideas?
.table-row:nth-child(even) {
background: gray !important;
}
Try this:
.rt-tr-group:nth-child(even) {
background: #ccc;
}
You need to choose the parent
element for the background to take effect.
Perfect - thank you!
If I set a table to use the new Infinite Scrolling feature Scrollable tables - #13 by mseflek then the CSS does not work for the table.
Is there a way to have the nth row background as part of a scrolling table?
Victroria from Retool solved this - it works for nth-child background color settings in a scrolling table
Thanks @victoria
#rt-table-documentsTable > div:nth-child(2) > div > div > div:nth-child(odd) {
background-color: blue;
}