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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying 4 images per line on web page 1

Status
Not open for further replies.

karren

Programmer
Feb 26, 2002
42
CA
hi everyone,

I'm making a database-driven site and i'm calling about 24 images from the database to be displayed on the web page. but i want only 4 images to be displayed per line so there is no horizontal scrolling. i'm not sure how to do this and from what i have tried, i'm not getting any success.

i was wondering if someone could direct me to which steps i need to take in order to display all 24 images on the page, but only 4 per line?

any tips will be greatly appreciated!

thanks,

karren
 
Hi...
im not sure this is what you want to do or not...
but, you can make a table and in a loop, creat a row and
add four cells to it and close the row and open an other row...
like this :
<table border=&quot;1&quot;>
<%
n = 1
Do While Not objRS.EOF
If n = 1 Then
Response.Write &quot;<tr>&quot; & vbcrlf
End If
Response.Write &quot;<td><img src='your image here'></td>&quot;
If n = 4 Then
Response.Writ &quot;</tr>&quot; & vbcrlf
n = 1
End If
n = n + 1
objRS.MoveNext()
Loop
If n <> 4 Then
Response.Write <td colspan='&quot; & 4 - n & &quot;'></td></tr>&quot; & vbcrlf
End If
%>
</table>

----
TNX.
E.T.
 
great!!! thanks so much ehsant! :) this is exactly what i was looking for!

cheers,

karren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top