by . .
Feedback
|
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days):
24985/
69
|
|
|
Step 6 : Alternating Colour |
Step 6 : Alternating color
Ok, that may be fine
for you, but I like to alternate my color. This requires a bit more work.
We have to put 2 rows of data in 1 While statement and do the row color
at the same time.
<table
border=1><tr><td><strong>Addresses</strong></td><td><strong>City</strong></tr>
<% While Not RecordSet1.EOF
Response.Write("<tr
bgcolor=gray><td>") 'Put in a bgcolor for the 1st
row
%><%=(Recordset1.Fields.Item("Address").Value)%><%
Response.Write("</td><td>")
%><%=(Recordset1.Fields.Item("City").Value)%><%
RecordSet1.MoveNext 'From here down, copy and paste from above.
Response.Write("<tr
bgcolor=silver><td>") 'Change bgcolor for the 2nd
row
%><%=(Recordset1.Fields.Item("Address").Value)%><%
Response.Write("</td><td>")
%><%=(Recordset1.Fields.Item("City").Value)%><%
RecordSet1.MoveNext
Wend
%></td></tr></table> |
Simple copy and paste
from the comment but I change the row bgcolor on the second one. And this
looks like this:
|
|
|
User Comments
Title:
Real
Name:
Rizwan
Date:
2005-01-15 4:51:56 AM
Comment:
Great! What simple real way of teaching. Great Many thanks to Mr. Author!
|
|
Product Spotlight
|
|