?
Solved

Creating alternating row colors

Posted on 2007-11-14
3
Medium Priority
?
741 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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