Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

3 in a row record output - (tiled) 1

Status
Not open for further replies.

doorbreaker

Programmer
Nov 19, 2002
91
0
0
GB
Hi,

I want to display images in rows of 3. The image name comes from the database and I am going through the recordset and outputting each image.

i.e

x x x
x x x
x x x

How do I do this?

All I can do at the moment is have them like:

x
x
x

Can anyone help on this issue?

Thanks

 
I had to deal with the similar problem in the past and Sheco and damber helped me out...her you go...try something like this:

Code:
If rs.EOF AND rs.BOF Then 

Response.Write "No Images found!"

Else
<table>
<%
  count = 0
  myMod = 0
  do while not rs.EOF
    myMod = count mod 3
    
    if (myMod = 0) then Response.Write "<tr>"

    'Write table data cell here
    Response.Write "<td>" & rs("myimage") & "</td>"

    if (myMod = 2) then Response.Write "</tr>"

    count = count + 1
    rs.MoveNext
  loop

  select case myMod
    case 0
      Response.Write "<td>&nbsp;</td><td>&nbsp;</td></tr>"
    case 1
      Response.Write "<td>&nbsp;</td></tr>"
    case 2
  end select
%>
</table>
<%end if%>

-DNG
 
Brilliant - thanks very much for this - it works perfectly!

Also thanks then to the original helpers.

Have a great day.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top