Do you want your asp table that you are displaying to have different colours on each line so that it makes it easier to read?

Here is the code:

<table>
<% Dim intRow
intRow = 0 %>
<tr bgcolor=”#FFFFFF”> <% ‘ this line makes the whole table white %>
<% While ((Repeat1__numRows <> 0) AND (NOT rsRecordset.EOF)) %>
<% If intRow = 0 Then %>
<tr bgcolor=”#CCCCCC”> <% ‘ this line says, that the first time round make the bgcolor cccccc %>
<% intRow = 1
Else %>
<tr bgcolor=”#FFFFFF”><% ‘ this line says that the second time round make the bgcolor ffffff %>
<% intRow = 0
End If %>

<td><%=(rsRecordset.Fields.Item(“company_name”).Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsRecordset.MoveNext()
Wend
%>
</table>

I hope this helps you.

About Paul Ogier

Paul Ogier has written 202 posts.

Paul Ogier is an IT Guru, Website Developer, and generally a nice guy. He loves code and he loves design.