Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

alternate row color

 
arjun rampal
Ranch Hand
Posts: 125
  • 0
  • 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;
}
%>
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See Bear Bibeault's solution in this link.
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • 0
  • 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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic