Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

<% if Odd %> doesn't work


Reply


903 Views

Avatar
gakenny

Community Member, 153 Posts

7 December 2007 at 11:44pm

Hello,

I have been trying to use <% if Odd %> to alternate background colours of a list. This works for the first and second entries. However, the third and greater entries have the same background colour as the second entry.
<% if Odd %>
<tr class="bg_colour1">
<% else %>
<tr class="bg_colour2">
<% end_if %>

However, <% if Even %> works fine and provides an alternative method to achieve the same result.
<% if Even %>
<tr class="bg_colour2">
<% else %>
<tr class="bg_colour1">
<% end_if %>

Anyone experienced the same issue?

Cheers,

Gary