...

View Full Version : asp repeat.



Baleric
04-30-2006, 01:18 AM
hey guys, i was wondering how to do a .asp repeat that instead of just listing items down the page it lists 3 items per row then drops down a line...

eg.
1 2 3
4 5 6
7 8 9

thanks in advance,

-baleric

Baleric
04-30-2006, 04:20 AM
ok i have figured out how to do the tables and list the records in the table,
but the thing is it lists the 1st record over and over again,
and when i try to add a repeat it stuffs the whole thing up,
do i also need a code that basically says "if theres no more records stop"

here is my code so far.


<table border="1" cellpadding="10" bordercolor="#0000FF">

<%

for i = 1 to 3
%>
<tr>
<%
for j = 1 to 3
%>
<td> <%=Itemsrs("Product")%> </td>
<%
next
%>
</tr>
<%
next


%>

</table>

Baleric
04-30-2006, 05:25 AM
all done...


<table border="1" cellpadding="5" bordercolor="#0000FF">

<%
DO WHILE NOT rs.EOF
Response.Write("<tr>")

FOR i = 1 TO 3
%>
<td>
<%
IF rs.EOF THEN
%>
No Record
<%
ELSE
%>
<%= rs("Product") %>
<%
rs.MoveNext
END IF
%>
</td>
<%
NEXT

Response.Write("</tr>")
LOOP %>
</table>

degsy
05-02-2006, 02:47 PM
You can also use MOD
http://www.asp101.com/articles/steven/mod/default.asp

Baleric
05-03-2006, 09:43 AM
that looks better and look like you have more control over what u are doing,

thank alot :)

cheers

baleric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum