Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

smarty if div by 3 with equal spacing

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-13-2003, 02:00 AM
 
ciava ciava is offline
 

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

Default smarty if div by 3 with equal spacing

Hi All

I have managed to get my subcategories.tpl to be div by 3, the only problem, is that the subcategories listings are not evenly spaced out


http://www.savatrader.com/products/customer/home.php?cat=115

does anyone know how to add an even spacing between the subcategories listings

many thanks
anton
Reply With Quote
  #2  
Old 03-13-2003, 05:28 AM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default Table Spacing

Looks like you have some issues with the TD width percentages.

Your Code:
Code:
<table width="100%" border=0 cellspacing=5> <tr> </tr> <tr> <td align=left nowrap width=20%> <font class="TableCenterSubCategoryListTitleBlue">Accessories</font></td> <td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">(30)</font></td> <td align=left nowrap width=20%> <a href="home.php?cat=250&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">CD Roms</font></a></td> <td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">(0)</font></td> <td align=left nowrap width=20%> <a href="home.php?cat=251&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">DVD Recorders</font></a></td> <td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">(6)</font></td> </tr> <tr> <td align=left nowrap width=20%> <a href="home.php?cat=135&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">IDE Internal CD-RW</font></a></td> <td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">(12)</font></td> <td align=left nowrap width=20%> <a href="home.php?cat=253&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">External CD-RW</font></a></td> <td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">(13)</font></td> <td align=left nowrap width=20%> <a href="home.php?cat=252&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">DVD Roms</font></a></td> <td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">(11)</font></td> </tr> <tr> <td align=left nowrap width=20%> <a href="home.php?cat=254&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">Notebooks Drives</font></a></td> <td align=left width="80%"> <font class="TableCenterSubCategoryListQuantityBlue">(32)</font></td> </tr> </table>

Change to:
Code:
<table width="100%" border=0 cellspacing=5> <tr> </tr> <tr> <td nowrap width=20%> <font class="TableCenterSubCategoryListTitleBlue">Accessories</font></td> <td width="20%"> <font class="TableCenterSubCategoryListQuantityBlue">(30)</font></td> <td nowrap width=20%> <a href="home.php?cat=250&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">CD Roms</font></a></td> <td width="20%"> <font class="TableCenterSubCategoryListQuantityBlue">(0)</font></td> <td nowrap width=20%> <a href="home.php?cat=251&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">DVD Recorders</font></a></td> <td width="20%"> <font class="TableCenterSubCategoryListQuantityBlue">(6)</font></td> </tr> <tr> <td nowrap width=20%> <a href="home.php?cat=135&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">IDE Internal CD-RW</font></a></td> <td width="20%"> <font class="TableCenterSubCategoryListQuantityBlue">(12)</font></td> <td nowrap width=20%> <a href="home.php?cat=253&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">External CD-RW</font></a></td> <td width="20%"> <font class="TableCenterSubCategoryListQuantityBlue">(13)</font></td> <td nowrap width=20%> <a href="home.php?cat=252&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">DVD Roms</font></a></td> <td width="20%"> <font class="TableCenterSubCategoryListQuantityBlue">(11)</font></td> </tr> <tr> <td nowrap width=20%> <a href="home.php?cat=254&PHPSESSID=38fe09827b809eae0dc070da7ba56a7d"><font class="TableCenterSubCategoryListTitleBlue">Notebooks Drives</font></a></td> <td width="20%"> <font class="TableCenterSubCategoryListQuantityBlue">(32)</font></td> </tr> </table>

You have a total of 5 columns, so I changed the percentage on each to 20% (20 * 5 = 100). I also got rid of your align=left tage since by default each column should align left. I assume you did that in the hopes that it would solve your spacing problem. If not, you may need to add that back in.

Hope this helps!
Reply With Quote
  #3  
Old 03-14-2003, 02:52 AM
 
ciava ciava is offline
 

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

Default

Hi machnhed1

my template only had 2x coloums and the div by 3 code turned into five,
but playing with the TD width has resolved my problem by just having 1x td width=33%

thanks
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:50 AM.

   

 
X-Cart forums © 2001-2020