[Opensource] "zebra striping" question
Peter A. J. Pilgrim
peterp at xenonsoft.demon.co.uk
Wed Jul 31 18:08:34 PDT 2002
Michael Rimov wrote:
> At 11:27 AM 7/23/2002 -0600, you wrote:
>
>> We want to display output objects pulled out of an element iterator in
>> alternating colors. Has anyone done this before? In addition to
>> alternating colors, we would like to display outputs in different
>> places in
>> a table. For example:
>>
>> first position:
>> <tr>
>> <td>one record</td>
>>
>> second, third (any middle) position
>> <td>another record</td>
>>
>> last position:
>> <td>last position</td>
>> </tr>
>
>
>
I forgot the other part
<%= counter.intValue() %>
So you can do this in JSP
<table ... >
<logic:iterate .... indexId="counter" >
<tr bgcolor="<%= counter.intValue() ? "#C0C0C0" : "E0FFE0" >
<td>
...
</td>
</tr>
</logic:iterate>
</table>
This should give the financial market spreadsheet style alternating row
--
Peter Pilgrim +-----\ +-++----++----+
Java Technologist | | | || || | 'n' Shine
| O | | || --+| ---+
/\ | ._ / | | \ \ | |
/ \ | | \ \ | |+-- || ---+ A new day
/_ _\ "Up" | | | | | || || | is coming
|| +-+ +-+ +-++----++----+
<home page="http://www.xenonsoft.demon.co.uk/" />
More information about the Opensource
mailing list