Zebra stripes on table rows using Rails / RHTML
<% @projects.each_with_index do |project, i| %> <% row_class = i%2 == 0 ? "even" : "odd" %> <tr class="<%= row_class %>"> ...... <% end %>
In the CSS:
TR.even { background-color: #f00; } TR.odd { background-color: #f00; }
etc..