I want to set every first and second tr with a different class.
With my code I only get "odd" on every tr.
Does anyone knew what is wrong?
$rowCount = 0;
if ($rowCount++ % 2 == 1 ) :
echo "<tr class='even'>";
else:
echo "<tr class='odd'>";
endif;
$rowCount = 0every time. Can you provide a bit more information. Also, why wouldn't you just use a conditional operator? e.g.echo '<tr class="' . (($rowCount++ % 2) ? 'even' : 'odd') . '>'