Re: [SMARTY] 3 photos at one row
| From: | messju mohr | Date: | Fri, 21 Nov 2003 16:49:22 +0000 |
| Subject: | Re: [SMARTY] 3 photos at one row | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10583@lists.php.net to get a copy of this message | ||
another one with {math}
{* compute number of cells *}
{math equation="count + (cols - count % cols) % cols"
count=$data|@count cols=$cols assign=loop}
<table border="1">
{section name=t loop=$loop}
{* index is 0..n-1 *}
{if $smarty.section.t.index is div by $cols}<tr>
{/if}
{* " " for empty cells *}
<td>{$data[t]|default:" "}</td>
{* iteration is 1...n *}
{if $smarty.section.t.iteration is div by $cols}</tr>
{/if}
{/section}
</table>
On Fri, Nov 21, 2003 at 04:31:16PM +0100, messju mohr wrote:
> okay, if everybody posts: here is one from me (caution! it uses simple
> math from 2.6.0. actually it's the first (and since that the last)
> useful application of simple-math i found, yet)
>
>
> {* $cols is the number of columns you want *}
> <table border=1>
> {section name=tr loop=$data step=$cols}
> <tr>
> {section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+$cols}
> <td>{$data[td]|default:" "}</td>
> {/section}
> </tr>
> {/section}
> </table>
>
>
>
>
> On Fri, Nov 21, 2003 at 09:13:18AM -0600, Eduardo wrote:
> > Hi,
> >
> > You can use this plugin:
> > http://smarty.incutio.com/?page=PaddedTableCellsPlugin
> >
> > Hope this help.
> >
> > Later
> > Eduardo.
> >
> > -----Original Message-----
> > From: Jiøí Nìmec [mailto:konference@menea.cz]
> > Sent: Friday, November 21, 2003 4:53 AM
> > To: smarty-general@lists.php.net
> > Subject: [SMARTY] 3 photos at one row
> >
> > Hello,
> >
> > I have got problem displaing photos in photogallery. There's an
> > array with image width, height, filename etc.
> >
> > i need in template writeout 3 photos in one <TR>, but I can not use
> > html_table.
> >
> > is there some solutuion how to write out 3 photos per one row?
> >
> > thank you for any help!
> >
> > Ji??í N??mec, ICQ: 114651500
> > www.menea.cz - www stránky a aplikace
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php