Solved

Creating alternating row colors

Posted on 2007-11-14
3
735 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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 …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

815 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

8 Experts available now in Live!

Get 1:1 Help Now