T
TanStack2y ago
rival-black

StripedRows

Hello everyone, I was wondering if there is a css class or something to add stripedRows style on the table? every even rows are white and odd ones are grey? Thanks a lot!
1 Reply
harsh-harlequin
harsh-harlequin2y ago
Hi, sorry for late reply. Yes, you can work around :nth-child to add coloring to the rows depending if they're odd or even. https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child#trnth-childodd
MDN Web Docs
:nth-child() - CSS: Cascading Style Sheets | MDN
The :nth-child() CSS pseudo-class matches elements based on the indexes of the elements in the child list of their parents. In other words, the :nth-child() selector selects child elements according to their position among all the sibling elements within a parent element.

Did you find this page helpful?