This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

alternate row color

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have to make alternate color rows.


now possible solution is below but it is giving one extra line below table.so i dont want to use this.


is there any idea

thanxs<%
int num = 0;
String SLATE = "#E4E4E4";
String WHITE = "#FFFFFF";
String bgColor = null;
%>

<logic:iterate id="element" name="dateMap">
<%
num++;
if((num % 2) == 0) {
bgColor = SLATE;
} else {
bgColor = WHITE;
}
%>
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See Bear Bibeault's solution in this link.
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

This is one of the ways to make alternate colored rows.

<logic:iterate id="displayresult" name="searchuserForm" property="searchresults" >
<tr>
<td class="tablecolumndark">
<bean:write name="result" property="firstName"/></td>
</tr>
<tr>
<td class="tablecolumnlight">
<bean:write name="displayresult" property="lastName"/></td>
</tr>
</logic:iterate>

The "tablecolumndark" and "tablecolumnlight" can be defined in the css. I think that should work.

Regards,
Roshani
SCJP 1.4
 
I didn't like the taste of tongue and it didn't like the taste of me. I will now try this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic