Please help with column display

Hi all,

Thank you in advance for taking the time help. I have this piece of code that is meant to display root category along with it sub categories. I want 3 fixed columns . Now every time I add new category it just create a new columns. site can be viewed here. http://tt.easy2sell.net

[code]{include file=‘t_javascript_language.tpl’}
{set_css}
{set_js}

{$category_pathway} {if $current_category->catname!=""}
{include file='elements/display_fields.tpl' position='categoryicon' this_add=$current_category->id}
	<strong>{$current_category->catname}</strong>
	
	<div class="adds_subcat" style="text-align:right;background:#F5F5F5; border:1px solid #FFFFFF; " >
	
	{include file='elements/display_fields.tpl' position='categorydetails' this_add=$current_category->id}
	
	<span style="font-size:12px;">
	
	{jtext text="ADS_SUBCATEGORIES"}:   {$current_category->kids} {jtext text="ADS_ADS"}: {$current_category->nr_ads}
		<a href="{$current_category->view}" title="{jtext text='ADS_VIEW_LISTINGS'}">
			<img src="{$IMAGE_ROOT}view_listings.gif" class="ads_noborder" alt="{jtext text='ADS_VIEW_LISTINGS'}" />
		</a>					
	</span>
	</div>
</div>
{/if}	
{if $categories|@count<=0}
	<h2>{jtext text="ADS_NO_CATEGORIES_DEFINED"}</h2>
{/if}
<table id="adds_categories" class="ads_table">
  <tr>
  {assign var="col" value="0"}
  {section name=category loop=$categories}
	{if $col == $numCols}
        </tr><tr>{assign var="col" value="0"}
    {/if}
		<td width="16.6%" class="adsman_catcell" valign="top">
			<div class="adds_maincat" {if $categories[category]->watchListed_flag}class="cat_watchlist"{/if}> 
				
				{include file='elements/display_fields.tpl' position='categoryicon' this_add=$categories[category]->id}
				<a href="{if $categories[category]->kids>0}{$categories[category]->link}{else}{$categories[category]->view}{/if}" >
					{$categories[category]->catname}
				</a>
				{if $categories[category]->is_new}
					<!--NEW!!-->
					<img src="{$IMAGE_ROOT}new.png" alt="new ads" />
				{/if}
				<a href="{$categories[category]->view}" title="{jtext text='ADS_VIEW_LISTINGS'}">
					<img src="{$IMAGE_ROOT}view_listings.gif" class="ads_noborder" alt="{jtext text='ADS_VIEW_LISTINGS'}" />
				</a>					
				{if $is_logged_in}
					{if $categories[category]->watchListed_flag}
						<img src="{$IMAGE_ROOT}watchlist.png" width="16"class="ads_noborder" />
					{/if}
					<a href="{$categories[category]->link_watchlist}">
						<img src="{$categories[category]->img_src_watchlist}" width="16" class="ads_noborder" title="{if $categories[category]->watchListed_flag}{jtext text='ADS_REMOVE_FROM_WATCHLIST'}{else}{jtext text='ADS_ADD_TO_WATCHLIST'}{/if}"/>
					</a>
				{/if}
				<br />
			</div>
			
			<div class="adds_subcat" style="background:#F5F5F5; border:1px solid #FFFFFF; " >
			{include file='elements/display_fields.tpl' position='categorydetails' this_add=$categories[category]->id}
			<br />
			
			{section name=subcategory loop=$categories[category]->subcategories}
			
				{include file='elements/display_fields.tpl' position='categoryicon' this_add=$categories[category]->subcategories[subcategory]->id}
				<a href="{if $categories[category]->subcategories[subcategory]->kids>0}{$categories[category]->subcategories[subcategory]->link}{else}{$categories[category]->subcategories[subcategory]->view}{/if}">{$categories[category]->subcategories[subcategory]->catname}</a> 
				{if $categories[category]->subcategories[subcategory]->is_new==1}
					<img src="{$IMAGE_ROOT}new.png" alt="new ads" />
			 	 {/if}
					({$categories[category]->subcategories[subcategory]->nr_a} {jtext text="ADS_ADS"})
				{if $categories[category]->subcategories[subcategory]->watchListed_flag}
					<img src="{$IMAGE_ROOT}watchlist.png" width="16" class="ads_noborder" />
				{/if}
				{if $is_logged_in}
				<a href="{$categories[category]->subcategories[subcategory]->link_watchlist}">
					<img src="{$categories[category]->subcategories[subcategory]->img_src_watchlist}" width="14" class="ads_noborder" title="{if $categories[category]->subcategories[subcategory]->watchListed_flag}{jtext text='ADS_REMOVE_FROM_WATCHLIST'}{else}{jtext text='ADS_ADD_TO_WATCHLIST'}{/if}"/>
				</a>
				{/if}
				<br />
				<p style="margin-left:25px;">
				{include file='elements/display_fields.tpl' position='categorydetails' this_add=$categories[category]->id}
				</p>
			{/section}
			</div>
		</td>
    {assign var="col" value="`$col+1`"}
{/section}
{assign var="remainder" value="`$numCols-$col`"}
{section name=emptyElement loop=$remainder}
    <td>&nbsp;</td>
{/section}
</tr>
</table>
[/code]

Many thanks in advance for your help.

Sponsor our Newsletter | Privacy Policy | Terms of Service