I have a unordered list with 3 items in every row (instead of the default 1). Now I want to alternate the row colors. How would I do that?
So basicially I want to do something like this:
if ($listCount == 1, 2, 3 OR 7, 8, 9 OR 13, 14, 15) {
$alternateRow = "rowOdd";
}
else {
$alternateRow = "rowEven";
}
(I know this is a syntax error, just trying to explain)
I think it’s possible with modulus but to be honest I don’t really understand how it works.
Indeed, modulo. You can test for
($listCount - 1) % 6 < 3.