Results 1 to 2 of 2

Thread: Help with displaying records from query

  1. #1
    Join Date
    Oct 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with displaying records from query

    Hi,

    I currently write the results from my queries in list view (ie, one row at a time) but I want to be able to write the results in grid view, (ie, 3 or four records in each row until results have ended)

    So say if a query returned 10 results, I want to display the results as follows:

    1 2 3
    4 5 6
    7 8 9
    10

    instead of:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    Any help will be greatly appreciated.

    Thanks,

    Manny

  2. #2
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Count the loops

    What i usually do is declare a "dummy" variable and then count in the loop.
    For example:

    i = 1
    <tr>
    <% WHILE NOT objRS.EOF

    i = 1 + i
    Response.Write "<td>" & whatever & "</td>"
    IF i = 4 THEN
    Response.Write "<tr>"
    i = 1
    END IF
    objRS.MoveNext
    WEND
    %>
    </tr>
    Hopefully this "logic" makes a little send and guides you in the right direction. Without seeing your actual code, I cant really say much more.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •