Web Hosting Talk







View Full Version : PHP & image tables


Justin M
10-13-2008, 05:20 PM
So, I'm stuck. I have a php script that reads in each image from a directory and displays them, along with a link to that picture. However, I can only get one picture in a column like this:

X
X
X

whereas I want three images per column [as with photobucket]:

X X X
X X X
X X X

and so on. Is this possible with only php, or am I better off using javascript as well?

Jaseeey
10-13-2008, 10:23 PM
Add a counter starting at one. For every image, have another variable do modulus on that counter. If the remainder is 0, then add in the end table row tags and enter the new table row tags with it.

vibrokatana
10-13-2008, 10:29 PM
Use "display: inline" in your CSS style sheet and the browser should fill them in horizontally.