Laying out thumbnails
Posted: Tue Sep 07, 2004 8:31 am
I've managed to create a php script that reads thumbnails from a directory into an array. So I have an array called images() with 20 image names. Example, 001.jpg, 002.jpg, 003.jpg etc etc.
Depending on the page the user is viewing I need to be able to lay these thumbnails out in a 4x4 table....4 rows of 4 images across with filename captions as well.
Does anyone know of a good way to do this? I was thinking a couple of for loops to generate something like:
If the user is on page 1 they should be able to see images 1 - 16, page 2 = 17 - 32 etc. I have the pagination sorted out but can't seem to come up with a clean looking loop system to get them into a table.
Any ideas out there?
Brad
Depending on the page the user is viewing I need to be able to lay these thumbnails out in a 4x4 table....4 rows of 4 images across with filename captions as well.
Does anyone know of a good way to do this? I was thinking a couple of for loops to generate something like:
Code: Select all
<table>
<tr>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
</tr>
<tr>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
</tr>
<tr>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
</tr>
<tr>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
<td><img src="thumbnails/imageX/></td>
</tr>
</table>Any ideas out there?
Brad