I'm not familiar with taglibs but I'm assuming that your taglib is
performing some sort of looping mechanism to generate the table data. If
so, I think you need to define and initialize the integer 'count' outside of
your loop first, otherwise if the statement 'int count=0' is inside your
looping construct then you will always just execute the if clause because
the variable 'count' is always being set to zero and zero divided by
anything will always have a remainder of zero.
Just my 2 cents worth.
-----Original Message-----
From: Dan Lopez [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 7:57 AM
To: [EMAIL PROTECTED]
Subject: Re: Rowcolor...
I followed the mod2 framework as provided in the
example. It still doesnt change color :(. Provided
is a sample of the code I have been trying
out...Please
point me in the right direction, I am stuck. Thanks a
bunch!
CODE==================================================
<% {Resultset Gotten here and formatted with
taglibs}%>
<%
int count = 0;
String bgcolor;
if (count%2 == 0) {
bgcolor="lightgrey";
} else {
bgcolor="lightblue";
}
count++;
%>
<tr bgcolor="<%= bgcolor %>">
<td width="189" height="17">
<div align="left"><%= a %></div>
<td width="189" height="17">
<div align="left"><%= b %></div>
<td width="182" height="17">
.
.
....etc...
</tr>
=====================================================
--- "Straight, Christian" <[EMAIL PROTECTED]> wrote:
> This works fine but shouldn't that be mod2 as
> follows:
>
> int count = 0
> String bgcolor;
>
> if (count%2 == 0)
> bgcolor="some color";
> else
> bgcolor="some other color";
>
> count++;
>
>
> Christian Straight
> Inovant
>
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets