views:

137

answers:

2

Is there an alternative to using 'Cycle' when creating zebra tables in Zend. ( My version does not have Cycle helper and don't really want to have to upgrade.

Using a partial loop and need each table to put out different bg color. However the partial loop doesnt seem to act as a standard loop with no repeat

A: 

I'd use javascript, as long as that's not crutial ;)

$('#table row:even').addClass('even');
Tomáš Fejfar
A: 

I think you're right, the cycle helper seems to reset for every iteration of partialLoop()... which would be consistent with the documentation.

I've gotten round this by using the partial loop's counter, like so:

<tr class="<?php print ($this->partialCounter%2) ? "odd" : "even"; ?>">
    <td>Test</td>
    <td>Test</td>
    <td>Test</td>
</tr>