How to change back ground color of the row in asp

mrong
mrong used Ask the Experts™
on
I have the following table in asp. How do I change the background color. That is one row in ivory and one row in white....repeats to the end.

 Do While Not rsItems1.EOF
"<TR ALIGN=CENTER BGCOLOR=ivory>" & _
        "  <TD><A HREF=""Search.asp?Action=Edit&Proj=" & rsItems1("ID") & """>" & _
                   rsItems1("ID") & "</A></TD>" & _
         "  <TD>" & rsItems1("Name")&"</TD>" & _
         "  <TD>" & rsItems1("Addr")&"</TD>" & _
         "  <TD>" & rsItems1("City") & "</TD>" & _
         "  <TD>" & rsItems1("State") & "</TD>" & _
                 
         "</TR>"
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Web Ninja at large
Commented:
try this:
rowNum = 0
Do While Not rsItems1.EOF
if rowNum = 0 then
    rowColor = "ivory"
    rowNum = rowNum + 1
else
   rowColor = "white"
   rowNum = 0
end if

"<TR ALIGN=CENTER BGCOLOR=" & rowColor & ">" & _
        "  <TD><A HREF=""Search.asp?Action=Edit&Proj=" & rsItems1("ID") & """>" & _
                   rsItems1("ID") & "</A></TD>" & _
         "  <TD>" & rsItems1("Name")&"</TD>" & _
         "  <TD>" & rsItems1("Addr")&"</TD>" & _
         "  <TD>" & rsItems1("City") & "</TD>" & _
         "  <TD>" & rsItems1("State") & "</TD>" & _
                 
         "</TR>"

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial