Well, I use style sheets and have a class for "header" and a class for "row1" and "row2" so I have a td.header and a td.row1/row2. I then make a php function that handles this:
function colorSwitch()
{
static $style;
if ($style == "row2") {
$style = "row1";
} else {
$style = "row2";
}
return $style;
}
}
So, INSIDE my actual while or for loop where I'm outputting results where I want to work this I just type:
$rc = colorSwitch();
Then, each row output would look like:
<td class="<? echo $rc ?>"><? echo $result["whatever"] ?></td>
If you don't use style sheets just substitute style with bgcolor. Also, if you don't use style sheets I suggest you learn how cause they are the bomb 🙂