vaguely complicated tables
| From: | Kerin Cosford | Date: | Fri, 29 Aug 2003 13:42:34 +0000 |
| Subject: | vaguely complicated tables | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10154@lists.php.net to get a copy of this message | ||
Hi,
This is my first stab at using Smarty, so bear with me. I've liked what
I've seen so far, and had no real problems, until I came to try and
display an associative array in a HTML table. I thought the html_table
function would do what I'm looking for, but that only seems to support a
table with one item of data per cell. What I'm looking to do is produce
a table that looks something like this :
<table>
<tr>
<td>
<div>
<img src="{$arr.var1}" />
<p>{$arr.var2}</p>
<p>{$arr.var3}</p>
</div>
</td>
<td>
<div>
<img src="{$arr.var1}" />
<p>{$arr.var2}</p>
<p>{$arr.var3}</p>
</div>
</td>
<td>
<div>
<img src="{$arr.var1}" />
<p>{$arr.var2}</p>
<p>{$arr.var3}</p>
</div>
</td>
</tr>
</table>
, with multiple rows.
Hopefully I'm missing something obvious, because at the moment, the only
way I can see that this is possible is to concatenate my array so that
it just contains multiple elements that combine all of my values, and
their HTML, which kind of defeats the purpose of trying to seperate
logic from display structure.
Anybody got any ideas?