another way:

<logic:iterate name="yourForm" property="yourProperty" id="yourId" indexId
="counter">

<tr class="<%= ((Integer)pageContext.getAttribute("counter")).intValue() %
2 == 0 ? "odd" : "even"%>" >




|---------+---------------------------->
|         |           Marc Walter      |
|         |           <[EMAIL PROTECTED]|
|         |           ch.com>          |
|         |                            |
|         |           13/07/2005 17:13 |
|         |           Please respond to|
|         |           "Struts Users    |
|         |           Mailing List"    |
|         |                            |
|         |                            |
|         |                            |
|         |                            |
|---------+---------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                 |
  |       To:       "Struts Users Mailing List" <user@struts.apache.org>        
                                                 |
  |       cc:                                                                   
                                                 |
  |       bcc:                                                                  
                                                 |
  |       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]







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

Reply via email to