I have a site that lists a companies products (lots). It has a database table containing these records. I want to loop the records to show 2 accross and the rest down (2 records per row by unlimited rows). it is possible because i made a mistake on an ordinary loop and it did this but i lost my mistake and can't remember what i did.

Help is appreciated ( :eek: I got a deadline :cry: )

13 Years
Discussion Span
Last Post by sutil

So are you trying to loop through the records so its 2 records a single row? I really dont understand what you are trying to do... :s


Ok so at about 12 (very late) I came up with a solution

<table width="300" border="1" cellspacing="0" cellpadding="0">
    <% Dim nextline, todisplay, endof
todisplay = 2
nextline = 0 
endof = 0
    <% do while endof <> (Recordset1_total) AND (NOT Recordset1.EOF)%>
    <% endof = endof + 1 %>
    <% If nextline = todisplay Then %>
    <% nextline = 0 %>
    <% End If %>
    <% nextline = nextline + 1 %>
    <%  Recordset1.MoveNext() %>
    <% loop %>

The "Recordset1_total" is the amount of total records in the recordset

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.