|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ndrea60rm Smarty Rookie
Joined: 05 Jan 2004 Posts: 9 Location: Rome (Italy)
|
Posted: Mon Jan 12, 2004 8:57 am Post subject: Table tags inside command section |
|
|
I want to build a table wit two colums inside command section....Is it possible?
The following code doesn't work
assuming that array-data is $IDART
Code: | <table border='$smarty.config.tbBorder'>
{section name=IDART loop=$IDART}
<tr>
<td>{$IDART[IDART]}{$IDART[articolo]}</td>
</tr>
{/section}
</table> |
Thanks for all..
Smarty is GREAT!!
Andy _________________ Andy B.
--fast & furius-- |
|
Back to top |
|
Gerald Smarty Regular
Joined: 26 Nov 2003 Posts: 53 Location: Lyon [France]
|
Posted: Mon Jan 12, 2004 9:12 am Post subject: |
|
|
EG of a two columned table
(i made assumptions on your exemple)
Code: | <table>
{section name=tabLoop loop=$tab}
<tr>
<td>{$tab[tabLoop].IDART}</td><td>{$tab[tabLoop].ARTICO}</td>
</tr>
{/section}
</table>
|
in PHP
Code: | <?php
$tpl->assign ('tab', array (array ('IDART'=>'1', 'ARTICO'=>'value1'), array ('IDART'=>'2', 'ARTICO'=>'value2')));
?> |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|