Hi,
thanks for your post, and sorry for the trouble.
The reason for this is that the priority of the alternating row colors is a bit higher here, because that uses more elements in the CSS selector.
Please try again with
.tablepress-id-123 tr .column-1 {
background-color: rgb(250,250,250);
}
(I also changed the .tablepress to .tablepress-id-123 so that you can choose to apply this only to a specific table, instead of to all TablePress tables.)
Regards,
Tobias
Thread Starter
aspotz
(@aspotz)
Thank you for the quick reply!
It doesn’t quite emulate the example given here: https://www.datatables.net/examples/styling/display.html
because that code changes the background color of every row in column 1 instead of just “overlaying” or darkening each row by a certain amount. Would you happen to know how to address that? As well as apply to all rows of the column except the header row?
Hi,
ah, you want alternating row colors there as well. For that, try this CSS approach:
.tablepress-id-123 tbody tr.odd .column-1 {
background-color: rgb(250,250,250);
}
.tablepress-id-123 tbody tr.even .column-1 {
background-color: #cccccc;
}
Regards,
Tobias
Thread Starter
aspotz
(@aspotz)
Thank you!
For those interested, here is the final code to get the behavior I wanted:
.tablepress tbody tr.odd .column-1 {
background-color: #f1f1f1;
}
.tablepress tbody tr.even .column-1 {
background-color: #fafafa;
}
.tablepress tbody tr:hover .column-1 {
background-color: #eaeaea;
}
Hi,
yes, that would also do the hover effect. 🙂
Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!