deekayen: I agree with and appreciate what you wrote. As a side note, the example I gave was for creating alternating rows in a table (using PHP). I discovered a solution which is even better for this sort of "back and forth" type of coding. It's simply using $i%2 to alternate a class every other line. Then I just have two css styles which vary the color in the rows.
$i = 1;
foreach ($rows as $row) {
echo '<tr class="row' . ($i % 2) . '">';
// TD $row stuff.
echo '</tr>';
$i++;
}
