DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Victor has posted 16 posts at DZone. View Full User Profile

Alternating Rows

12.14.2005
| 780 views |
  • submit to reddit
        // description of your code here

<% if ( j % 2 == 0) { %>
     <tr class="TBGG2">            
<% } else { %> 
     <tr class="TBGG1">          
<% } %>
    

Comments

Victor Tolbert replied on Tue, 2005/12/13 - 9:55pm

<% String rowClass = " "; if ( j % 2 == 0) { rowClass = "even"; } else { rowClass = "odd"; } %> ">