Alternatively, you can set up a simple loop counter and use the Mod operator to determine the color:
Code:
<%
Dim BackGroundColor
Dim LoopCount
LoopCount = 0
Do Until Rs.EOF
If LoopCount Mod 2 = 0 Then
BackGroundColor = "#00ff00"
Else
BackGroundColor = "#cc6666"
End If
%>
<tr style="background-color:<%=BackGroundColor%>">
<td><%=Rs("fieldname1")%></td>
<td><%=Rs("fieldname2")%></td>
</tr>
<%
Rs.MoveNext
LoopCount = LoopCount + 1
Loop
%>
This code will alternate the rows by looking at LoopCount. If LoopCount divided by 2 does not leave a remainder, the color #00ff00 is used, otherwise #cc6666 is used.
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to:
Regen En Patchoulli by
Spinvis (Track 13 from the album:
Spinvis)
What's This?