How to alternate table or list row colors in the partialLoop call of Zend.
The code snippets below should give you the idea. Every alternating TR tag will have a class of "alt". Then, in the style sheet, just define a background color for TR tags with that class. The trick here is to save the state in the parent view, which is accessed through the PartialLoop helper. You can also use this trick to print index numbers or sequences in the list.
<tr class="<?php print (!$this->getHelper('PartialLoop')->view->altrow ^= 1) ? 'alt' : ''; ?>">
<td><?php echo $this->escape($this->Id); ?></td>
<td><?php echo $this->escape($this->FirstName); ?></td>
<td><?php echo $this->escape($this->LastName); ?></td>
</tr>
<style type="text/css">
table.example tr.alt td { background-color: gray; }
</style>
<table class="example">
<tr>
<th>Id</th>
<th>Last</th>
<th>First</th>
</tr>
<?php echo $this->partialLoop('example/partialList.phtml', $this->names); ?>
</table>