I am using primeNG tree table for angular4 and I am trying to style it that odd and even rows has different colors. I am able to do it but only for root rows, when you expand the rows it will get the row color of it's parent.
I also checked the markup produced in html but there's no class that indicates if a row is odd or even.
How exactly do we do it?
A year has passed and in the new version it's as easy as using the normal nth-child on the rows:
.ui-treetable-table {
tbody {
tr:nth-child(even) {
background: #e9ecef;
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With