X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   smarty if div by 3 with equal spacing (https://forum.x-cart.com/showthread.php?t=1854)

ciava 03-13-2003 02:00 AM

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

machnhed1 03-13-2003 05:28 AM

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!

ciava 03-14-2003 02:52 AM

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 :D


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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.