How to highlight the background of alternate table row using CSS
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 CSS
":nth-child"
selectorYou can use the CSS3
:nth-child
selector to highlight the background of alternate table row for creating a zebra-striped table. The:nth-child(N)
pseudo-class accepts an argumentN
, which can be a keyword, a number, or a number expression of the formxn+y
wherex
andy
are integers (e.g.1n
,2n
,3n
,2n+1
,3n-2
, …). Try out the following example to see how it works:output: