Phoenix_666
Мастер
- Регистрация
- 27 Дек 2007
- Сообщения
- 165
- Реакции
- 33
- Автор темы
- #11
Вот код отформатированный в табличке. Все строки таблицы формируются правильно. Таблице не "ломается". Правда вроде притормаживает при кликах.
<table cellspacing="0" cellpadding="0">
{section name=i loop=$root_categories}
{if $smarty.section.i.index is div by 1}{* tr *}{/if}
<tr>
<td align="left" height="30" class="tree">
<a href="index.php?categoryID={$root_categories[0]}">{$root_categories[1]}</a>
</td>
</tr>
{* show sub categories *}
{assign var="tmp" value=0}
{section name=j loop=$root_categories_subs}
{if $root_categories_subs[j][3] == $root_categories[0]}
{if $categoryID == $root_categories_subs[j].categoryID}
<tr>
<td align="left" height="30" class="tree">
<img src="images/arrow_category_small.gif" width="6" height="5"> <b>{$root_categories_subs[j][1]}
</td>
</tr>
{else}
<tr>
<td align="left" height="30" class="tree">
<img src="images/arrow_category_small.gif" width="6" height="5"> <a href="index.php?categoryID={$root_categories_subs[j][0]}" class=standard>{$root_categories_subs[j][1]}</a>
</td>
</tr>
{/if}
{/if}
{/section}
{if ($smarty.section.i.index+1) is div by 2}{/if}
{/section}
</table>
<table cellspacing="0" cellpadding="0">
{section name=i loop=$root_categories}
{if $smarty.section.i.index is div by 1}{* tr *}{/if}
<tr>
<td align="left" height="30" class="tree">
<a href="index.php?categoryID={$root_categories[0]}">{$root_categories[1]}</a>
</td>
</tr>
{* show sub categories *}
{assign var="tmp" value=0}
{section name=j loop=$root_categories_subs}
{if $root_categories_subs[j][3] == $root_categories[0]}
{if $categoryID == $root_categories_subs[j].categoryID}
<tr>
<td align="left" height="30" class="tree">
<img src="images/arrow_category_small.gif" width="6" height="5"> <b>{$root_categories_subs[j][1]}
</td>
</tr>
{else}
<tr>
<td align="left" height="30" class="tree">
<img src="images/arrow_category_small.gif" width="6" height="5"> <a href="index.php?categoryID={$root_categories_subs[j][0]}" class=standard>{$root_categories_subs[j][1]}</a>
</td>
</tr>
{/if}
{/if}
{/section}
{if ($smarty.section.i.index+1) is div by 2}{/if}
{/section}
</table>