View Single Post
  #2  
Old 01-08-2003, 07:10 PM
 
Ventrue Ventrue is offline
 

Newbie
  
Join Date: Oct 2002
Posts: 9
 

Default I have my Subs in two columns

I looked through the Smarty Code website and figured out how to get mine into two columns, I am sure you can easily do four with some modifications.

Here is the code for Two Columns
Code:
<table width=100%> <TR> <TD width=100%> <table border=0 cellspacing=5 width=100%> <TR> <TD colspan=3><Center><U>Shop by Category</U> </TD> </TR> <TR> <td align=left valign=top width=50%> {section name=cat_num loop=$subcategories max=4} <font size=2>{ $subcategories[cat_num].category|escape }</font> { if %cat_num.last% } {/if} {/section} </td> <TD width=1 bgcolor=#B10304></TD> <td align=left valign=top width=50%> {section name=cat_num loop=$subcategories start=4} <font size=2>{ $subcategories[cat_num].category|escape }</font> {/section} </TD> </tr> <TR> <TD colspan=3 height=1 bgcolor=#B10304></TD> </TR> </table> The Key is this "start=4}" You would put that at each place you would like it to start a new column. So for example in column one you would have the code with the "max=4}" which means only 4 products per line. on the next column you would put "{section name=cat_num loop=$subcategories start=4}" this starts the second column on the fifth product and continues on till the 8th product. On the third line you would put "{section name=cat_num loop=$subcategories start=8}" and this would start that line on the 9th product and so on and so on. Though the Key here is the <table> code like in my example, that code is what allows it to show up as 4 columns. Good Luck, If you need more help let me know.

[/code]
Reply With Quote