Created
September 2, 2016 15:36
-
-
Save xErik/f72684fc66d614593e1bd355d200b9da to your computer and use it in GitHub Desktop.
Create table with Smarty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table id="frontpage_categories_new"> | |
<tr> | |
{$cols=3} | |
{foreach $module_content as $module_data} | |
<td style="width:300px;"> | |
<a href="{$module_data.categories_link}"> | |
<img src="{$smarty.const.DIR_WS_IMAGES}categories/{$module_data.categories_image}"> | |
{$module_data.categories_name} | {$smarty.foreach.foo.iteration neq 1 AND $smarty.foreach.foo.iteration is div by 3} | |
</a> | |
</td> | |
{if !$module_data@last AND $module_data@iteration is div by $cols} | |
</tr><tr> | |
{/if} | |
{if $module_data@last AND $module_data@iteration is not div by $cols} | |
<td colspan="{$cols-$module_data@iteration%$cols}"></td> | |
{/if} | |
{foreachelse} | |
<td colspan="{$cols}">No data</td> | |
{/foreach} | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment