Re: [SMARTY] table sections
| From: | Monte Ohrt | Date: | Tue, 07 May 2002 13:26:06 +0000 |
| Subject: | Re: [SMARTY] table sections | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4066@lists.php.net to get a copy of this message | ||
Do the links a,b,c need to be in separate table cells?
If not, you could do it like this:
{* figure out how many elements per column, assign to $col_total *}
{math equation="ceil(total / cols)" cols=2 total=$var assign="col_total"}
<tr>
<td>
{section name=foo loop=$var}
$var[foo]<br>
{if not $smarty.section.foo.last and $smarty.section.foo.iteration is div by $col_total}
{* start next column *}
</td><td>
{/if}
{/section}
</td>
</tr>
Arleen Sáles wrote:
i've done research and found similar examples and even a table function
provided peter bowyer, however, i'd like to achieve the result using
sections.
if a solution has already been posted to this question, could you please
direct me to it?
i just want to display my links from a database query in table format this
way:
link a link d
link b link e
link c link f
thank you in advance.
arleen.
--
Monte Ohrt <monte@ispi.net>
Director of Technology, ispi Inc.