0

Hi

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: )

3
Contributors
4
Replies
5
Views
12 Years
Discussion Span
Last Post by sutil
0

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

0

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

<table width="300" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <% 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 %>
  </tr>
  <tr>
    <% End If %>
    <% nextline = nextline + 1 %>
    <td><%=(Recordset1.Fields.Item("ID").Value)%></td>
    <%  Recordset1.MoveNext() %>
    <% loop %>
  </tr>
</table>

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.