JavaKB
JavaKB

Reputation: 468

AngularJS zebra striping for table with hidden rows

I am trying to add zebra stripe to a table which has hidden rows (uses ng-hide to hide). Because angular only hides the rows, whether I use css3 or jQuery to strip, the coloring is not correct, you can see the sample below.

Row 3 is hidden, Row 2 and Row 4 are having same color.

Here is the Plunker.

How can I solve this?

Upvotes: 3

Views: 1214

Answers (1)

j.wittwer
j.wittwer

Reputation: 9497

One approach would be to use ng-if, instead of ng-hide. This would prevent the element from being created, rather than hiding it. Then the css would work as expected.

Here is a working plnkr

Upvotes: 4

Related Questions