0

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 doesn't seem to act as a standard loop with no repeat

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Rhys Thought
  • 3,019
  • 2
  • 17
  • 5

2 Answers2

1

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

$('#table row:even').addClass('even');
Tomáš Fejfar
  • 11,129
  • 8
  • 54
  • 82
1

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>
user222174
  • 43
  • 5