marksquall
04-20-2006, 01:43 AM
Dear Weddeveloper members,
A pleasant day to every one.
I'm currently working on this site that's using ASP for database connection. I have a link that when it's clicked, it will view all records in my MSAccess document (the file is list.asp). I just wonder how to alternate the colors of the row (I'm planning to have it simply white and light gray)as it loops until all the records are found.
These are the lines I'm working on:
<table>
<% while not rs.eof %>
<tr align="center" valign="top" bgcolor="#000000">
<td><%=rs.fields(1)%></td>
<td><%=rs.fields(2)%></td>
<td><%=rs.fields(3)%></td>
<td><%=rs.fields(4)%></td>
<td><%=rs.fields(5)%></td>
<td><%=rs.fields(6)%> </td>
</tr>
<%rs.movenext%>
<%wend%>
</table>
I hope I didn't erase important "details" on my table (I tried to delete my table formats so that everyone can see my code a little bit clear, hehehe).
So, if I have 20 records, then those codes will eventually generate 20 rows to display the records. I hope to get these rows have alternating colors so that is easy and clear to view such records. I hope you could help me.
Thanks everyone and more power.
Warm Regards,
MarkSquall
A pleasant day to every one.
I'm currently working on this site that's using ASP for database connection. I have a link that when it's clicked, it will view all records in my MSAccess document (the file is list.asp). I just wonder how to alternate the colors of the row (I'm planning to have it simply white and light gray)as it loops until all the records are found.
These are the lines I'm working on:
<table>
<% while not rs.eof %>
<tr align="center" valign="top" bgcolor="#000000">
<td><%=rs.fields(1)%></td>
<td><%=rs.fields(2)%></td>
<td><%=rs.fields(3)%></td>
<td><%=rs.fields(4)%></td>
<td><%=rs.fields(5)%></td>
<td><%=rs.fields(6)%> </td>
</tr>
<%rs.movenext%>
<%wend%>
</table>
I hope I didn't erase important "details" on my table (I tried to delete my table formats so that everyone can see my code a little bit clear, hehehe).
So, if I have 20 records, then those codes will eventually generate 20 rows to display the records. I hope to get these rows have alternating colors so that is easy and clear to view such records. I hope you could help me.
Thanks everyone and more power.
Warm Regards,
MarkSquall