On Thu, Oct 16, 2008 at 9:35 AM, Walter Cruz <[EMAIL PROTECTED]> wrote:
>
> Hi all. I'm trying to remove the webhelpers.rails from my project, but
> can't find a equivalent of cycle. What can I do?

% for i, element in enumerate(c.elements):
<tr class="${i %% 2 and 'odd' or 'even'}">

This will give you alternating even/odd rows.  Note that i=0 for the
first row, so I've reversed the 'odd' and 'even' labels to make the
first row odd.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to