Add key=count to foreach
<{foreach item=item from=$items key=count}>
<{if $count is div by 2}>
<{/if}>
<{$item.name}> |
<{$item.summary}> |
< ;td><{$item.date}>
<{if ($count+1) is div by 2}>
<{/if}>
<{/foreach}>
Place three <{$item.name}> in each line and change the parameters as much as you like!
< ;tr>
<{foreach item=item from=$items key=count}>
<{$item.name}> |
<{if ($count+ 1 ) is div by 3}><{/if}>
<{/foreach}>
Another use Cycle is used as an example of line wrapping, but it can only achieve the effect of wrapping two data in each line. It can only wrap two lines.
<{foreach item=item from=$items}>
<{$item.name}> ;/td>, |
"}>
<{/foreach}>
The above introduces smarty line wrapping examples and table wrapping, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.