MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old January 27th, 2004, 01:17 AM
redbirdsgm redbirdsgm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Toronto
Posts: 6 redbirdsgm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 23 sec
Reputation Power: 0
Send a message via AIM to redbirdsgm
alternate records

I am really new at this. I have basic results working. What I want to do is alternate every other record with a new CSS Style so it's easier to read. Not sure how to do this so anything would be helpful. I want to use the class ' statsDataRow1 ' and ' statsDataRow2 ' as my alternating styles.

Thanks
Rob
----------------------------------------------------------------------------------

<table border="1" width="85%">
<%do until rs.EOF%>
<tr>
<td class="statsDataRow1"><%Response.Write(rs("Nickname"))%>
<td class="statsDataRow1"><%Response.Write(rs("FirstName"))%>
<td class="statsDataRow1"><%Response.Write(rs("LastName"))%>
<td class="statsDataRow1"><%Response.Write(rs("E-mail"))%>
<td class="statsDataRow1"><%Response.Write(rs("AOL"))%>
<td class="statsDataRow1"><%Response.Write(rs("Birthday"))%>

<%rs.MoveNext%>
</tr>
<%loop

rs.Close
conn.Close
%>

</table>

Reply With Quote
  #2  
Old January 27th, 2004, 07:15 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,343 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 8 h 5 m 22 sec
Reputation Power: 891
i think your question would be better suited in the ASP or VB forum (or whatever language that is) than the SQL Server forum

but anyhow, if your scripting language does not already provide a built-in record number for query results, declare a variable yourself and add 1 to it every time you go to print a record

when you print a record, divide the record number by 2 and examine the remainder -- it will be 0 or 1, and that will tell you which class to apply

look for a MOD or MODULO or MODULUS function to get you the remainder automatically

also, your html will be cleaner if you apply the class to the TR instead of each individual TD
__________________
r937.com | rudy.ca

Reply With Quote
  #3  
Old January 27th, 2004, 03:25 PM
redbirdsgm redbirdsgm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Toronto
Posts: 6 redbirdsgm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 23 sec
Reputation Power: 0
Send a message via AIM to redbirdsgm
Thank you. I realized after I posted it was in the wrong spot.

Thanks again

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > alternate records


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway