struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd G. Nist" <tn...@bellsouth.net>
Subject RE: alternating row colors in the iterate tag.
Date Tue, 10 Sep 2002 23:13:11 GMT
Nanijon,

You can find the a taglib for this at:
http://jakarta.apache.org/struts/resources/taglibs.html once there look down
the page for RowTag, works quite well.

If you would prefer to use a scriplet then the following will work:

<style>
/* Even row */
td.row0 {
	background-color: #FFFFFF;
}
/* Odd row */
td.row1 {
	background-color: "#ffffcc";
}
</style>
...
<logic:iterate ... indexId="i" ...>
<tr><td class="row<%= i % 2 %>">your text or data here</td></tr>
</logic:iterate>

Hope this helps.

Regards,
Todd G. Nist

-----Original Message-----
From: Nani Jon [mailto:nanijon2000@yahoo.com]
Sent: Tuesday, September 10, 2002 3:32 PM
To: Struts Users Mailing List
Subject: Re: alternating row colors in the iterate tag.



Hey Dave:
Would you be so kind to share that code? It will be greatly appreciated.
Thanks,
Nanijon.
 David Graham wrote:I don't think you can do it directly with the iterate
tag. I think there is
a tag in the jakarta taglibs project that does this. I wrote my own tag to
do it (it doesn't take long). You would use your tag within the iterate tag
to generate the
Dave

>
>Hi all:
>
>Is there a way to alternate row background colors within an >....> tag? I
was able to do it using java scriplet. The problem is the
>value of the varaible rowColor shows up on the JSP. Here is a snippet of
>the code in the JSP page:
>
>
>
>......
>
>>  String rowColor = "#ffffff";
>  String prevColor = "#ffffff";
>  String nextColor = "#ffffcc";
>%>
>
> .......
>
>.......
>
>>property="mainInfo.titleCollection" type="com.acs.backend.dao.MusicDAO">
> >
>
> <......>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>---------------------------------
>Do You Yahoo!?
>Yahoo! Finance - Get real-time stock quotes




_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com


--
To unsubscribe, e-mail:
For additional commands, e-mail:



---------------------------------
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message