How to highlight alternate table row using jQuery
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Use the jQuery
:nth-child()
selectorYou can use the jQuery
need an explanation for this answer? contact us directly to get an explanation for this answer:nth-child()
selector to create the zebra striped table by highlighting its alternate rows. The:nth-child(N)
selector accepts these arguments — the index of each child to match (starting with1
), the string even or odd, or an expression (e.g.:nth-child(2)
,:nth-child(even)
,:nth-child(2n)
. Let's take a look at an example: