[web] horizontal loops w/ smarty

This topic is 4732 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

i have some data {0,1,2,3,4,5,6,7,8,9} i would like to arrange it like this using the smarty template engine: 0 1 2 3 4 5 6 7 8 9 unfortunately, i cant get it to do this. i can have a single column, but not two because I cannot increment the loop counter. do any of u know how to get past this?

Share on other sites
Use the step argument :-)

<table>
{section name=i loop=$data step=2} <tr><td>$data</td><td>\$data[i+1]</td>
{/section}
</table>