You can use the jQuery :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 with 1), 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:
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: