tSpayde Posted February 19, 2007 Share Posted February 19, 2007 Hello. This is my first post here. I looked through using the search function and couldnt find an answer to this. Basically what I have is a site that allows a user to upload images to a specific folder. I then have a page that will display these images(just reads the contents of the folder and displays them). My problem is that I would like to format the way the pictures are shown. I would like to have only 3 images per line. So every three images I would like it to drop down to the next line. I am having troubles coming up with the code to do this. Hope I explained everything ok. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/39175-displaying-images/ Share on other sites More sharing options...
Orio Posted February 19, 2007 Share Posted February 19, 2007 That's pure html. Read about html tables. Orio. Link to comment https://forums.phpfreaks.com/topic/39175-displaying-images/#findComment-188670 Share on other sites More sharing options...
tSpayde Posted February 19, 2007 Author Share Posted February 19, 2007 I understand HTML tables.. There are images added and removed daily so I cant know how many rows im gonna need. Every way I try it either does all images into one row or all images in one column. I need to be able to limit 3 images per row and i have no clue how to go about that Link to comment https://forums.phpfreaks.com/topic/39175-displaying-images/#findComment-188682 Share on other sites More sharing options...
tom100 Posted February 19, 2007 Share Posted February 19, 2007 A lot of times I just end up using lazy logic and run a loop that says something like this: $x=0; echo "<tr>"; while (blah) { $x++; if ($x>3) { $x=0; echo "</tr><tr>"; echo "<td>My Stuff</td>"; } } echo "</tr>"; Link to comment https://forums.phpfreaks.com/topic/39175-displaying-images/#findComment-188685 Share on other sites More sharing options...
tSpayde Posted February 19, 2007 Author Share Posted February 19, 2007 Thanks.. That helps. I'm gonna mess around with some loops. A lot more helpful than the first reply. Link to comment https://forums.phpfreaks.com/topic/39175-displaying-images/#findComment-188692 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.