Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2004, 05:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default display different color in loop

I use following loop in asp.

<table align=center border="1" bordercolor="black" cellspacing="1" cellpadding="1" border=1 width="1100" height="15">
  <tr bgcolor=c0c0c0>

<th width="80" height="9" bgcolor="#C0C0C0"><span style="font-weight: 400">
    <em style="font-style: normal"><strong>
      Employee No</strong></em></span></th>
........ // all heading, before beginning the loop.

 </tr>

do while rs.eof=false
Response.Write("<td>" & rs("empno") & "</td>")
Response.Write("<td>" & rs("Name") & "</td>")
Response.Write("<td>" & rs("dept") & "</td>")
...........

rs.movenext
loop

</table>


how can display two color in each row ?
ie one row print data in light bue and next line (second line) print data in light green color.
1. light blue row
2. light green row
3. light blue row
4. light green row
5. ........
and so on.............

regards.

Mateen









 
Old June 16th, 2004, 06:05 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

dim v
v = 1
do while rs.eof=false
if v mod 2 = 0 then
   Response.Write("<tr bgcolor=blue>")
else
   Response.Write("<tr bgcolor=green>")
end if
Response.Write("<td>" & rs("empno") & "</td>")
Response.Write("<td>" & rs("Name") & "</td>")
Response.Write("<td>" & rs("dept") & "</td>")
...........
v = v + 1
rs.movenext
loop

Hope this helps..


Om Prakash
 
Old June 16th, 2004, 06:40 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for coding.

regards.

Mateen






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display color palette swati_joshi ASP.NET 1.0 and 1.1 Basics 0 March 28th, 2006 04:32 AM
Desperately Need Help with Loop & Display Script pupadu Classic ASP Basics 2 March 28th, 2005 07:56 PM
from color="red" to color='red' juaniux XSLT 2 November 16th, 2004 04:18 PM
color acko ASP.NET 1.x and 2.0 Application Design 7 January 1st, 2004 12:41 AM
nested while loop doesn't loop hosefo81 PHP Databases 5 November 12th, 2003 08:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.