PDA

View Full Version : Help with displaying records from query



Manny_56
04-15-2007, 11:20 PM
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

twick
04-16-2007, 02:59 AM
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.