Alex: [Smarty] Tabelle 4 Spalten, dann neue Zeile

Beitrag lesen

Hallo Stefan,

hab sowas mal mit zwei Spalten gemacht. Das ist aber sicher nicht ganz optimal. Vielleicht hilft es Dir aber trotzdem weiter:

<table>  
{section name=tr start=0 step=2 loop=$my_data}  
<tr>  
{section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+1}  
<td class="left">  
{if $my_data[td].id}  
{$my_data[td].text}  
{else}  
&nbsp;  
{/if}  
</td>  
{/section}  
{section name=td start=$smarty.section.tr.index+1 loop=$smarty.section.tr.index+2}  
<td class="right">  
{if $my_data[td].id}  
{$my_data[td].text}  
{else}  
&nbsp;  
{/if}  
</td>  
{/section}  
</tr>  
{/section}  
</table>

Alex