Yes, I can see that you made some edits to product-listing.php. That is why I had to shut my mouth about my second point. You had already solved it perfectly
The issue with tables is that they take some of the alignment away from the css. A table will default to valign:center which means that the contents of a table cell are vertically centered. Which is fine except that it means that you loose some control over the vertical positioning of elements within the cells. This is pretty well documented.
In some cases it really isn't a problem. With a single line of text in each cell it looks fine. When things get more intricate with divs and images that have heights the results are sometimes unsatisfactory and adjusting the top and bottom margins of the elements contained with the cells doesn't always achieve the desired effect.
One solution to this is to set the valign of the table cells to align to the top of the cell. The advantage of this is that elements then align within the cells in the same way as they would inside a containing <div>. If you are used to styling within divs then this is comforting.
What you loose is the ability to align thing centrally vertically but this usually just means that you have an equally elegant layout but without vertical centering.
What I suggested in the earlier post is editing tpl_tabular_display.php to set the vertical align of all <tr> tags to be valign:top; . This means that every <td> has its contents aligned to the top of the cell. Then the individual elements in the cell can be aligned exactly as if the table cell was a div.
It should be noted that this will apply to all the cells in ALL of zen Cart that use this file as a template. ( I think that this is all of the tables but couldn't swear to it. ) If this is a problem then there is a fairly easy solution to only apply it on one page but that is for another post.
So, how does one give the <tr> tags a valign:top; ?
You need to edit the tpl_tabular_display.php. Preferably the override version of it. You will find it in includes / templates / YOUR TEMPLATE / common / . If it doesn't exist create it by copying the same file from template_default.
On a default version of this file without any previous edits you will find that line 26 reads :
You need to edit this to read:Code:<tr <?php echo $r_params; ?>>
Save it. Upload it.Code:<tr valign=top <?php echo $r_params; ?>>
Now all the tables in Zen Cart have a valign:top and you can position the elements within the cells using css to style the margins and padding. Although I'd try and stick with margin because of IE6.
Hope that makes more sense.
Nik
ps putting a colored border around individual elements often helps to see what is what. Also the web deleoper add on for firefox is great for this.




