?
Solved

Creating alternating row colors

Posted on 2007-11-14
3
Medium Priority
?
743 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 1000 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 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 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