CSS>
ALTERNATIVE ROWS
I almost fell on the floor when I saw this code... so simple and effective.
$k = 1 - $k
Typically I used to do things like:
k = (k == 0 ? 1 : 0); or...
if(k == 0) { k = 1; }else{k = 0;}
Shame on me. Here's how the new code works out:
k starts off as 0
when coming into your loop k then equals 1 - 0 (0 is its current value)
k now equals 1
on the next loop... k = 1 - 1 (1 is k's current value)
now k equals 0... and so on and so forth.