Click to See Complete Forum and Search --> : Need help sending to tables


olliedale
01-06-2003, 07:47 AM
:confused:

I am new to this and wondered if anyone could help...

I have a photo site that has a list of thumbnails... at the moment they are listed via php in one column in a table, but I want them to go into 4 columns...

What I want to say is:

if the array position is a multiple of 4 then create a new row

else put in the same row


know what I mean???

If you want, have a look at

http://www.photonz.com/spain/roll1

for an example...

thanks...

jeffmott
01-06-2003, 09:17 AM
I'm not as fluent in PHP as I am in Perl so what you're going to be getting is psuedo code.

write "<table><tr>"
foreach img (0 to [last image index])
&nbsp; &nbsp; if img mod 4 equals 0 then write "</tr><tr>"
&nbsp; &nbsp; write "<td><img src='images/" img ".jpg' alt=''></td>"
write "</tr></table>"

olliedale
01-06-2003, 09:24 AM
Yes, I see - very clever. Thanks. I'll go away and try to php it :)

If there was anyone who could translate the pseudo script faster than I will be able to, feel free to post it here...

Cheers again...