The key here is XHTML/CSS. Although this can be done with tables, it would require additional and unnecessary PHP.
How to do it:
I would suggest printing the list of images as an unordered list.
The xhtml would look somethign like this:
HTML Code:
<ul id="image-list">
<li>image 1</li>
<li>image 2</li>
...
<li>image n</li>
</ul>
<!--I'm throwing this in so you don't forget to clear the float, in turn screwing the layout up-->
<br class="clear" />
You would then add some simple css:
HTML Code:
/*
150px * 5 = 750px ( minmum width of ul if each image is 150px wide)
800px - 750px = 50px ( if using 800px for the ul width, 50px is left for spacing )
50px / ( 2 * 5 ) = 5px ( 5px on each side of the image )
*/
ul#image-list{
width:800px;
list-style-position:inside;
}
ul#image-list li{
float:left;
width:150px; /* max width of each image/profiledata */
margin:5px; /* creates 5px spacing between rows and images */
}
.clear {
clear:both;
}
Here is an article for reference:
http://www.alistapart.com/articles/multicolumnlists
I haven't tested the exact code above, but it should work. It should allow for a list of images 150px wide each, to appear in rows of 5. You can of course put your other data in the <li> along with the image.
Post back if you have any problems implementing this.
Last edited by bhgchris; 01-29-2008 at 03:04 PM..
Reason: forgot to add the .clear class =x
|