This can be done with the some CSS code that needs to be added to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:
.tablepress {
--hover-text-color: #111111;
--hover-bg-color: #f3f3f3;
}
Code language: CSS (css)
Here, the lines starting with --
indicate variables for the colors, with text
being the text color and bg
denoting the background color, for the currently hovered row. Just change the HEX color values as desired. You only need to specify the lines that you want to change.
If you prefer a visual interface for changing colors, check out the Default Style Customizer feature that is part of the TablePress premium license plans.
If you just want to change this for a specific table, use .tablepress-id-N
(with N
being the table’s ID) as the selector, instead of .tablepress
.
If the CSS code from above does not work, you can also try this alternative CSS code:
.tablepress .row-hover tr:hover td {
background-color: #ff0000;
color: #00ff00;
}
Code language: CSS (css)
You can change both the text color (via the color
property) and the background color (via the background-color
property).