|
<%
Option explicit
Dim array(20,0), i, intCounter, ColorClass
For i=0 to 20 ' This populates the array
array(i,0)="Row "&i
Next
%>
<html><head><title>Colored Table</title><style>
.class1{ background-color:#D7DFE7}
.class2{ background-color:#F1F4F7}
.TD{FONT-FAMILY: arial;FONT-SIZE: 12px;COLOR: #333333}
</style></head>
<body>
<table cellspacing="0" cellpadding="3" border="0" width="500" class="td">
<tr bgcolor="#CCD6E0">
<td><b>Column 1</b></td><td><b>Column 2</b></td><td><b>Column 3</b></td>
<td><b>Column 4</b></td><td><b>Column 5</b></td></tr>
<%
intCounter=0
for i=0 to ubound(array) ' Here we are displaying every single item stored in our array trough a loop
if intCounter mod 2 = 0 then ' This line determines whether the row's number is even or not
ColorClass="class1" ' This color will be the FIRST row and every other row
else
ColorClass="class2" ' This color will be the SECOND row and every other row
end if%>
<tr class="<%= ColorClass %>" height="20">
<td><%= array(i,0) %></td>
<td>Random Data 2</td>
<td>Random Data 3</td>
<td>Random Data 4</td>
<td>Random Data 5</td>
</tr>
<% intCounter=intCounter+1
next %>
</table></body></html>
|