Here is the way I accomplished this:

<c:forEach items="${sessionScope.??}" var="variable goes here"
varStatus="count">  
        <c:choose>
                <c:when test="${(count.count % 2) != 0}">
                        <tr bgcolor="#FFFFFF">
                </c:when>
                
                <c:otherwise>
                        <tr bgcolor="#EDEDED">
                </c:otherwise>
        </c:choose>
</forEach>

Also, take a look at this:
http://forum.java.sun.com/thread.jspa?forumID=45&threadID=252997

Adrian

__________________________________________________

Senior Programmer Analyst, Tax Distributed Systems Development

Tax & Compliance Development, ADP IT

Phone: (909) 592-6411 Ext. 3863

e-mail: [EMAIL PROTECTED]



-----Original Message-----
From: Marc Walter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 13, 2005 8:14 AM
To: Struts Users Mailing List
Subject: Re: Alternate color in html:iterate


Hi!

Try this:

<logic:iterate name="yourForm" property="yourProperty" id="yourId" indexId=
"counter">
<tr <% if ((((Integer) pageContext.getAttribute("counter")).intValue() % 2)
== 0) { %>class="odd"<% } else { %>class="even"<% } %>>

It works fine. Define the colours in your local css file for the classes
"odd" and "even".

Kind regards,
Marc Walter


-------------------------
Hi All,

I'm using html:iterate to display the set of records in the table. Is there
any way to put the alternate color using CSS classes in tag libraries


Thanks & Regards,
SenthilRajan VS



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-----------------------------------------
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an authorized
representative of the intended recipient, you are hereby notified that any
dissemination of this communication is strictly prohibited. If you have
received this communication in error, notify the sender immediately by
return email and delete the message and any attachments from your system.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to