[prev in list] [next in list] [prev in thread] [next in thread]
List: smarty-general
Subject: Re: [SMARTY] How can one create a table dynamically with Smarty ?
From: 82.83.13.176
Date: 2004-05-04 10:23:42
Message-ID: 20040504102425.36757.qmail () pb1 ! pair ! com
[Download RAW message or body]
Unfortunately this code doesn't work either:
<table>
<tr>
{section loop=$data name=i}
<td><a href="../images/company/einblicke/{$data[i].picture}"
target="_blank"><img
src="../images/company/einblicke/{$data[i].thumb}"></a><br />
{$data[i].descr}</td>
{if $smarty.section.i.index is div by 2 && $smarty.section.i.index != 0}
</tr>
<tr>
{/if}
{/section}
</tr>
</table>
There seem to be 3 colums
The first row has 3 pictures all others have 2. I can't figure out why this
is.
in this case $data is an 2dimensional array, as you will get it when
reading
some rows from a database. each row is an array stored as element of
another
one so here.
The 1st dimension i walk through with the section, the second one with
the foreach, because its associative.
hth
Ben
-----Ursprüngliche Nachricht-----
Von: Pete [mailto:webmaster@dentona.de]
Gesendet: Freitag, 30. April 2004 15:50
An: smarty-general@lists.php.net
Betreff: Re: [SMARTY] How can one create a table dynamically with Smarty
?
Hi Gabriel,
thank you very much for the reply.
Unfortunately that doesn't help at all.
The problem is that a multi column table is needed.
The code below will only produce a table with one column.
<table>
{section loop=$data name=i}
<tr><td>{$data[i].image}</td><td>{$data[i].description}</td></tr>
{/section}
</table>
Thx anyway and have a nice weekend!!
Regards Pete
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
__________________________________________________________
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.672 / Virus Database: 434 - Release Date: 28.04.2004
---
__________________________________________________________
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.672 / Virus Database: 434 - Release Date: 28.04.2004
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic