PDA

View Full Version : Rotating Cell Colours - ASP


Stealth
06-11-03, 08:38 PM
You see websites with cell colours rotated as each row is shown. Heres the code in ASP


<% Dim Cell_Count
Dim Cell_Colour %>

<table width="100%" border="1" cellspacing="0" cellpadding="0">

<% 'Loop 10 times
For N = 0 to 9
'Colours here. You can add more colours using the ElseIf function.
If Cell_Count = 0 then
Cell_Colour = "Green"
Else
Cell_Colour = "Red"
End If %>

<tr bgcolor="<%=Cell_Colour%>">
<td>&nbsp;</td>

<% 'Add more numbers as you add more colours by using the ElseIf function again!
If Cell_Count = 0 Then
Cell_Count = 1
Else
Cell_Count = 0
End If
Next %>

</tr>
</table>




its a bit muddled but hey, i got an excuse! its 1:30 am!!!