View Single Post
  #35  
Old 07-13-2010, 05:33 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Why are they still using tables for layout?

I didn't say it was impossible - I'm just saying if you have given the programmer a requirement to support variable heights - but still keep everything in a grid, and reduce white space - then a table is really easy, and css might be complex. I'm trying to answer your original question of why QT did it this way - their requirement is probably broader than yours.

I have replaced the tables on products_t with all css before - but only for clients that have everything fairly uniform and do not want to display too much data per product. But if I had a client who wanted to support all the data that QT has to support and wants it to be in a grid with reduced white space - I'd likely leave it in a table. When I am unsure what the client has in mind - I wait to remove the table - because it can cost them a lot in the future when upgrading or adding 3rd party mods, if they still want it to display in a grid.

In your latest question - you are talking about aligning product boxes. QT's table not only aligns the entire product box - but all the things in the product box - title, image, description, rating, on-sale stuff, etc - it is all in a grid.

You have to know your max and min heights as you move in a row across the grid to do it with css. A table has the advantage in that it can just set the height based on the biggest div that is in it. If you are stepping through the row with css, you don't know what the height of the next two divs are going to be, so you can't set it. You need to know in advance max and min heights, or put it all in a big row div. But then you don't have a div around the entire product.

Again - it can be done in css - I'm not discouraging you from doing it - I'm just trying to let you know the issues you come up against if you try and support all the mods and displays possible in products_t and then also support mods from 3rd parties, and keep a grid display.

Quote:
you couldn't put a background image around the individual product boxes
This is true. If this is your requirement - then you'll have to change the design. But if your requirement is to line everything up in a grid, then the changes you are proposing make that more difficult. There are always going to be customers with different requirements, and when they conflict, there will be differing opinions on what is more important.

To get an idea - try having a few titles that are really long and a few that are short, throw in a few thumbs of different heights. Turn on sales for some and not others - do as much stuff like that and cover as much of what QT is supporting as you can. Just keep it as a test page as you are developing the css to replace the table. I suspect you can do it - but it will be complex if you also require that these can be of any height - and you do not want a lot of white space. If you throw in your background-image requirement - then I think it will get really hard, but I could be wrong.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote