Solved

Creating alternating row colors

Posted on 2007-11-14
3
734 Views
Last Modified: 2009-03-20
WIN XP PRO
MS Access
DWMX
Classic ASP VBScript

Hello.  I have a standard DWMX Repeat Region on a table row.  How can I use Classic ASP VBScript to alternate the rows' colors for better visibility?

Thank you,
Shane
0
Comment
Question by:lshane
3 Comments
 
LVL 13

Accepted Solution

by:
samic400 earned 250 total points
ID: 20287308
mSwitch = 0

do while not mRS.EOF
    if mSwitch = 0 then
         response.write "<tr><td style='background-color:#CCCCCC'>"
         mSwitch = 1
      else
         response.write "<tr><td style='background-color:#FFFFFF'>"
         mSwitch = 0
     end if
   mRs.Movenext
Loop


0
 
LVL 25

Assisted Solution

by:imitchie
imitchie earned 250 total points
ID: 20288152
row = 0
do while not mRS.EOF
  ....
      response.write "<tr class='row"&row&"'>"
      row = (row + 1) mod 2
 ....
   mRs.Movenext
loop

and make sure your css has the classes tr.row0 and tr.row1
0
 

Author Comment

by:lshane
ID: 20293403
Thanks samic400 and imitchie.  I appreciate it.

That did the trick (A couple of different ways).


Thanks so much,
Shane
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now