Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Table tags inside command section

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
ndrea60rm
Smarty Rookie


Joined: 05 Jan 2004
Posts: 9
Location: Rome (Italy)

PostPosted: Mon Jan 12, 2004 8:57 am    Post subject: Table tags inside command section Reply with quote

I want to build a table wit two colums inside command section....Is it possible?
The following code doesn't work Confused

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
View user's profile Send private message
Gerald
Smarty Regular


Joined: 26 Nov 2003
Posts: 53
Location: Lyon [France]

PostPosted: Mon Jan 12, 2004 9:12 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP