display records in several TDs per TR?

Discussion in 'ASP General' started by btopenworld, Nov 28, 2003.

  1. btopenworld

    btopenworld Guest

    Could someone point me in the right direction for writing, say, three
    records into three table cells and then starting a new row for the next
    three records.

    (I've used While not EOF and MoveNext for writing each new record to a new
    row - hope several records per row isn't too complicated)

    Thanks

    John
    btopenworld, Nov 28, 2003
    #1
    1. Advertising

  2. btopenworld

    Dan Brussee Guest

    On Fri, 28 Nov 2003 00:15:14 +0000 (UTC), "btopenworld"
    <> wrote:

    >Could someone point me in the right direction for writing, say, three
    >records into three table cells and then starting a new row for the next
    >three records.
    >
    >(I've used While not EOF and MoveNext for writing each new record to a new
    >row - hope several records per row isn't too complicated)
    >
    >Thanks
    >
    >John
    >


    Although there are more complex, and more interesting ways of handling
    this, but the most straightforward method is...

    cnt = 1
    response.write "<TABLE>"
    response.write "<TR>"
    do while not rs.eof
    if cnt = 3 then
    response.write "</TR><TR>"
    cnt = 1
    end if
    response.write "<TD>"
    response.write "Data"
    response.write "</TD>"
    cnt = cnt + 1
    rs.movenext
    loop
    do while cnt < 3
    response.write "<TD>&nbsp;</TD>"
    loop
    response.write "</TR>"
    response.write "</TABLE>"
    Dan Brussee, Nov 28, 2003
    #2
    1. Advertising

  3. btopenworld

    btopenworld Guest

    Dan - thanks a lot - you'll gather I'm a beginner and your info was very
    helpful. John


    "Dan Brussee" <> wrote in message
    news:...
    > On Fri, 28 Nov 2003 00:15:14 +0000 (UTC), "btopenworld"
    > <> wrote:
    >
    > >Could someone point me in the right direction for writing, say, three
    > >records into three table cells and then starting a new row for the next
    > >three records.
    > >
    > >(I've used While not EOF and MoveNext for writing each new record to a

    new
    > >row - hope several records per row isn't too complicated)
    > >
    > >Thanks
    > >
    > >John
    > >

    >
    > Although there are more complex, and more interesting ways of handling
    > this, but the most straightforward method is...
    >
    > cnt = 1
    > response.write "<TABLE>"
    > response.write "<TR>"
    > do while not rs.eof
    > if cnt = 3 then
    > response.write "</TR><TR>"
    > cnt = 1
    > end if
    > response.write "<TD>"
    > response.write "Data"
    > response.write "</TD>"
    > cnt = cnt + 1
    > rs.movenext
    > loop
    > do while cnt < 3
    > response.write "<TD>&nbsp;</TD>"
    > loop
    > response.write "</TR>"
    > response.write "</TABLE>"
    btopenworld, Nov 28, 2003
    #3
  4. http://www.aspfaq.com/2247

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "btopenworld" <> wrote in message
    news:bq642h$bbl$...
    > Could someone point me in the right direction for writing, say, three
    > records into three table cells and then starting a new row for the next
    > three records.
    >
    > (I've used While not EOF and MoveNext for writing each new record to a new
    > row - hope several records per row isn't too complicated)
    >
    > Thanks
    >
    > John
    >
    >
    >
    >
    Aaron Bertrand [MVP], Nov 30, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S01aX3N0YXRl?=

    Quick one - Is SESSION per browser instance or per IP Address?

    =?Utf-8?B?S01aX3N0YXRl?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    5,864
    gerry
    Apr 10, 2006
  2. Razvan
    Replies:
    1
    Views:
    405
    tony vee
    Sep 10, 2004
  3. Replies:
    5
    Views:
    2,522
  4. bill

    Quick way to find all tds?

    bill, Feb 12, 2004, in forum: Javascript
    Replies:
    3
    Views:
    104
    Michael Winter
    Feb 12, 2004
  5. John Milton

    2 Tables, same width in tds?

    John Milton, Nov 7, 2004, in forum: Javascript
    Replies:
    2
    Views:
    103
Loading...

Share This Page