I am using this react bootstrap table with striped rows.
According to the docs, I can "Invert the colors of the table — with light text on dark backgrounds by setting variant as dark." However, the font color does not match the dark mode of my site so I would like to have a custom color. When I try to select the table elements, tr or td, it changes the color of only the non-striped rows. How do I select all the text, or even just the striped text at this point, to change the color?
You can customize the font color of the text inside the table rows by overriding the CSS styles. Since the striped rows have a specific class applied to them (
table-striped), you can target both the regular and striped rows with a custom CSS file or a styled component.To change the text color of just the striped rows, you only need to target the nth-of-type(odd) selector in your CSS.