I typically do the same - although I'll just assign the row a class value while looping through an array of result objects.
PHP Code:
<?php
$i = 0;
foreach ($results as $k => $v) {
if (++$i%2) $row='oddrow'; else $row='evenrow';
?>
<tr class="<?=$row;?>">
<td><?php $v->p('field1'); ?></td>
<td><?php $v->p('field2'); ?></td>
</tr>
<?php
}
?>