Hi,
I am using
struts 1.1. I have an Arraylist on my formbean. Using logic:iterate tag, i am displaying the the contents of the Arraylist on the
jsp. But at the same time, i need to show the alternate rows in different colors. e,g. First row (background) color should be in green, Second row (background) color should be in yellow, third row (background) color should be in green, and next row in yellow and so on.
I am using the mod function i.e counter%2 to identify odd row and even row using logic:equals tag, but this does not work.
The following is my code:
<logic:iterate id="users" name="searchForm" property="searchResultsUser" indexId="counter" >
<tr>
<logic:equal name="<%=counter.intValue()%2 %>" value="0">
<td class="greenRow"><bean:write name="users" property="firstName"/></td>
</logic:equal>
<logic:equal name="<%=counter.intValue()%2 %>" value="1">
<td class="yellowRow"><bean:write name="users" property="firstName"/></td>
</logic:equal>
</tr>
</logic:iterate>
How can i achieve the alternate colored row to diaplay my data in the list.
Any help would be greatly appreciated.
Thanks.