RE: [SMARTY] Re: How to generate a 3-column-table layout from an array of pictures.
| From: | Hoffman, Geoffrey | Date: | Wed, 04 Dec 2002 20:09:45 +0000 |
| Subject: | RE: [SMARTY] Re: How to generate a 3-column-table layout from an array of pictures. | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6639@lists.php.net to get a copy of this message | ||
This may help - I've solved things like this before (not with Smarty, but
with PHP) first you divide and round (down) to get the total # of 'full
rows' and then use the fmod() function to divide by the # of pics in your
row to get the remainder...
http://www.php.net/manual/en/function.fmod.php
then you have can loop through all of the full rows, and deal with the last
row of 1 or 2 pics (in your case) separately in a switch or if-then. (if the
modulo is 0 then you only have full rows - no remainder) I didn't see fmod()
in the code sample David posted, so this might be an alternative.