Re: column layout question

From: Date: Tue, 29 May 2001 15:11:52 +0000
Subject: Re: column layout question
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-839@lists.php.net to get a copy of this message
Hi, Andrei Zmievski wrote: > How about: > {if %sec.index% is div by 3 and not %sec.last%} > </td><td> > {/if} Nah, that doesn't work (the number of items is dynamic) I already got it: {if %sec.index% == ceil ( %sec.loop% / 2 ) } If there are 7 items in the loop, it puts 4 of them in the first column, 3 of them in the second. (If you want 3 in the first and 4 in the second, change ceil to floor. If this is used by a lot of people, we could maybe implement some easier way, like: {div=3 devider="</td><td>"} which would devide the items in 3 groups, separating each with <td></td>. Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl

« previous php.smarty.general (#839) next »