Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2003, 08:27 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old November 17th, 2003, 08:45 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old November 17th, 2003, 09:06 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old November 17th, 2003, 10:08 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old November 17th, 2003, 12:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

ok, thanks alot:)





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.