View Single Post
  #1  
Old 02-24-2003, 02:27 AM
 
ciava ciava is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: UK
Posts: 56
 

Default Help on if div by 2

Hi All

im having a few glitches with dividing the subcategory section into 2 per row.

i have done the following code, but when the subcategories, template loads, instead of dividing the subcategories by 2 per row, its putting them all in one line.



Code:
<table width="100%" border=0 cellspacing=5> {section name=cat_num loop=$subcategories} {if smarty.section.cat_num.index is div by 2} <tr> { if %cat_num.first% } {/if}{/if}<td align=left nowrap width=20%> <font class="TableCenterSubCategoryListTitleBlue">{ $subcategories[cat_num].category|escape }</font></td><td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">({ $subcategories[cat_num].product_count })</font></td> { if %cat_num.last% } </tr> {/if} {/section} </table> {/if}

If anyone could shed some light as where im going wrong, as i think i just have one of the ending if staments in the wrong place.

Many thanks
Reply With Quote