Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 17th, 2003, 08:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default Listing records

Hi there

I'm wanting to display the output of a select statement on a web page. However, my problem arises because I don't want to display them as a list; I want to loop through them displaying 2 records horizontally next to each other on the page (i.e in a table) and then the next 2 in a table underneath and so it goes on.

Can anyone help me here?

thanks alot

Adam
Reply With Quote
  #2 (permalink)  
Old November 17th, 2003, 08:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just keep a count as you're going through the records and write a new <tr> when theCount Mod 2 = 0
Reply With Quote
  #3 (permalink)  
Old November 17th, 2003, 09:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

thanks Phil

Do you have an example I might be able to follow?

I've tried using it like so:

 <%counter = 0%>
  <%do while not rsWeekdays.EOF%>
    <%counter = counter + 1
        if counter mod (7 + 1) = 0 then%>
        </tr>
        <tr>
       <%end if%>
            <td>
            <div align="center">&nbsp;&nbsp;|&nbsp;&nbsp;<a href="mypage.asp?TipID=<%=rsWeekdays("TipID")%>">& nbsp;&nbsp;<%=rsWeekdays("Weekday")%></a>
         <%rsWeekdays.movenext%>
               <%loop%>
</div></td>
          </tr>
        </table>

but that just seems to go horizontal across the page which is halfway to what I want but not the full way

Many thanks

Adam
Reply With Quote
  #4 (permalink)  
Old November 17th, 2003, 10:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Adam, this line

if counter mod (7 + 1) = 0 then

will give you a new row every 8 records, so change it to

if counter mod 2 = 0 then

rgds
Phil
Reply With Quote
  #5 (permalink)  
Old November 17th, 2003, 12:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

ok, thanks alot:)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing by date golden_drifter Classic ASP Basics 5 June 30th, 2008 03:16 PM
Listing 8-10 and Listing 8-16. Asp.Net BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 February 6th, 2008 01:11 PM
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Listing records based on a count harg7769 Access 3 April 8th, 2005 03:15 AM



All times are GMT -4. The time now is 12:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.