Column Not Showing Correctly in Table

General ShopSite user discussion

Column Not Showing Correctly in Table

Postby greyn » Thu Feb 19, 2009 4:20 pm

I am using the code below to display mini version of the main products. It generate 3 columns within a table. This works great, but when there is only 1 product assigned to the page, it only generate 1 column stretching across the entire table. It is only a problem when 2 or less products are assigned to the page; fine with 3 or more.

I like to have it show 3 columns regardless of the number of products. Can someone help? Thankie.

<table width="100%" border="0" cellspacing="2" cellpadding="0" id="products">
[-- VAR.colCounter 1 --]
[-- VAR.lastRowCounter 1 --]
[-- LOOP PRODUCTS 3 --]
[-- PRODUCTS --]
[-- VAR.colCounter INC --]
[-- VAR.lastRowCounter INC --]
[-- IF VAR.colCounter 4 --]
[-- VAR.colCounter 1 --]
[-- END_IF --]
[-- END_LOOP PRODUCTS --]
</table>
greyn
 
Posts: 6
Joined: Thu Feb 19, 2009 4:08 pm

Postby loren_d_c » Thu Feb 19, 2009 4:43 pm

Have you tried just including your own table row with 3 empty cells right after the opening table tag? Assuming the <td> created in your product template does not contain the colspan=3 attribute, the single cell in the row created when there is only one product on the page would fall in line with the first cell in your own table row. You may also want to specify widths for your empty cells. For example, something like:

Code: Select all
<tr><td width=100></td><td width=100></td><td width=100></td></tr>
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

fixed

Postby greyn » Thu Feb 19, 2009 5:14 pm

Loren, you rock! I added the code below and it worked. Now just need to fine tune it a bit. Thanks!

Code: Select all
<tr><td width=34%></td><td width=33%></td><td width=33%></td></tr>
greyn
 
Posts: 6
Joined: Thu Feb 19, 2009 4:08 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 62 guests