Kishore Senji wrote:
On Thu, 27 Jan 2005 12:49:00 +0530, senthil Kumar <[EMAIL PROTECTED]> wrote:
Hi all.
I am getting more than 100 regards from database and print in a JSP by 15 regards per Page. Its is working fine. Now i want to set alternative Row background color. I print all the rows between the <logic:iterator> in Struts. any one help me.
Here i am putting my code also. welcome anyone to give correct code also,
<logic:iterate id="collection" name="DFThreadForm" scope="session" property="selectRegsList" > <tr bgcolor="#c2c2c2">
<logic:iterate id="collection" name="DFThreadForm" scope="session" property="selectRegsList" indexId="index"> <tr bgcolor='<%=index.intValue()%2==0?"#c2c2c2":"#d2d2d2"%>'
Instead of setting bgcolor, set the class attribute:
class='<%= index.intValue()%2 == 0 ? "event" : "odd"%>
That way, you can use CSS to change the color easily on all of your pages at once.
tr.even { background-color: #C2C2C2; } tr.odd { background-color: #D2D2D2; }
-- Jeff
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]