You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tarun Sainanee <ta...@delhi.tcs.co.in> on 2002/08/06 11:54:47 UTC
alternate row color
Hi
I am using the logic:iterate tag to display multiple rows of a search
result.
Now to make it a little more presentable, i need to alternate the colour
of each row.
How can i do that?
TIA
Re: alternate row color
Posted by Daniel Jaffa <ja...@courtinnovation.org>.
I think there is a tag that does that,
----- Original Message -----
From: "Tarun Sainanee" <ta...@delhi.tcs.co.in>
To: <st...@jakarta.apache.org>
Sent: Tuesday, August 06, 2002 5:54 AM
Subject: alternate row color
> Hi
> I am using the logic:iterate tag to display multiple rows of a search
> result.
>
> Now to make it a little more presentable, i need to alternate the colour
> of each row.
>
> How can i do that?
>
>
> TIA
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: alternate row color
Posted by Michael Rimov <ri...@centercomp.com>.
At 03:24 PM 8/6/2002 +0530, you wrote:
>Hi
>I am using the logic:iterate tag to display multiple rows of a search
>result.
>
>Now to make it a little more presentable, i need to alternate the colour
>of each row.
It's funny, we JUST had that discussion on Expresso's Open Source
list. Solution by Peter Pilgrim:
<table ... >
<logic:iterate .... indexId="counter" >
<tr bgcolor="<%= counter.intValue() % 2 == 0 ? "#C0C0C0" : "E0FFE0" >
<td> ... </td>
</tr>
</logic:iterate>
</table>
Or you can use CSS for the striping etc.
HTH!
-Mike
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: alternate row color
Posted by fl...@flare.it.
On 6 Aug 2002 at 15:24, Tarun Sainanee wrote:
> Hi
> I am using the logic:iterate tag to display multiple rows of a search
> result.
>
> Now to make it a little more presentable, i need to alternate the
> colour of each row.
>
> How can i do that?
http://edhill.its.uiowa.edu/display-examples-0.8/
or just render the table using CSS, use a class for odd rows and a class for even
rows.
regards
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: alternate row color
Posted by "Todd G. Nist" <tn...@bellsouth.net>.
Tarun,
You could use the "RowTag" tablib found on the "Struts Resource" page.
http://jakarta.apache.org/struts/resources/taglibs.html
<%@ taglib uri="/WEB-INF/rowtag.tld" prefix="row" %>
<logic:iterate id="row" name="rows">
<row:row styleId="dataRow" oddStyleClass="gridRowOn"
evenStyleClass="gridRowOff">
</logic:iterate>
There is also support for the basic events, onclick, ondblclick....
Or you could achieve it with a scriplet.
I would stick with the tag if you can. We use and it works just fine.
Hope that helps.
Regards,
Todd G. Nist
-----Original Message-----
From: Tarun Sainanee [mailto:taruns@delhi.tcs.co.in]
Sent: Tuesday, August 06, 2002 5:55 AM
To: struts-user@jakarta.apache.org
Subject: alternate row color
Hi
I am using the logic:iterate tag to display multiple rows of a search
result.
Now to make it a little more presentable, i need to alternate the colour
of each row.
How can i do that?
TIA
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>