Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default I'm going to try to convert my site layout from tables to CSS... anyone have tips?

    I know that the web is moving away from using tables for layout and I want my site to be mostly CSS layout.

    There are a few places where I've had to use tables to get what I wanted, but for the main page (header, three columns, footer) I want it to be done in CSS.

    Before I undertake this endeavor, does anyone have any advice/tips? Anyone gone before me and want to share their experience?

  2. #2
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    Has anyone done this successfully before?

  3. #3
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    This Zenner apparently has:

    http://www.zen-cart.com/forum/showthread.php?t=192076

    Since the few tables that are used in Zencart work OK, it seems like a lot of work for little reward, though.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    The OP in that thread apparently had a functional reason for changing his listings from table to div - he wanted a different (non-tabular) layout. The existing product listing tables are functionally tables (information laid out with meaningful relationships between elements vertically and horizontally), and there is nothing theoretically or practically wrong with them unless you want a different kind of arrangement. In that case, installing Column Layout Grid from Free Addons will give a div layout, and there are extensions to that available for other listings.

    The one major layout table provides left/center/right columns, and if you want to change that to divs, you will need to be good with CSS to apply complicated, tricky fixes to completely replicate the column layout reliably in all circumstances. In other words, it's a bunch of work for no visible benefit. If you only care about modern browsers (including IE9 and newer), you can easily get the layout using display: table; and display: table-cell; CSS properties on #contentMainWrapper and the columns, but then you need to apply CSS/javascript fixes to get older IE (IE8-) to play nice.


    There are some templates in Free Addons (the Apple Zen series for one, I believe) which do have a div structure for the columns, so if that is important to you, start with one of those rather than trying to reinvent the wheel.
    Last edited by gjh42; 7 Feb 2012 at 05:08 PM.

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    Correction: IE8 does support display: table; and display: table-cell; - it was some other very useful and long-established CSS property that is only supported by IE9 and newer.

    I have used these properties (with a couple of IE6/7 hacks) for the next version of Ezpages Footer Columns, in final documentation phase, to simplify its structure and improve its reliability over the div styles used previously.
    Last edited by gjh42; 7 Feb 2012 at 05:16 PM.

  6. #6
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    Quote Originally Posted by gjh42 View Post
    There are some templates in Free Addons (the Apple Zen series for one, I believe) which do have a div structure for the columns, so if that is important to you, start with one of those rather than trying to reinvent the wheel.
    I'm just trying to keep the site up with the times, and the modern way of thinking is that it's wrong to use tables for layout...

    Apple Zen looks cool, but it says that having left sideboxes is impossible, and I need a three column layout. I can't stuff all of my sideboxes to the right column.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    I think the presence of that one very useful layout table will not cause any of your customers or reviewers to question your competence or hesitate about buying your products, which is the most important test for deciding whether to take on a new project. This would in actuality be solely for your own satisfaction.

    If you really want to try it, I would suggest the display: table; properties rather than the old workaround of floated divs; this will actually be using modern CSS instead of decade-old workarounds. If you are concerned about IE6/7 support (it will totally fail in those browsers), remember that they are the major reasons for the stock table's continued existence, and add whatever hacks or javascript fixes you need for them.

  8. #8
    Join Date
    Aug 2010
    Location
    21115 Glendale Ave Port Charlotte FL 33952
    Posts
    17
    Plugin Contributions
    0

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    WebKat

    I understand your ideas and drive behind staying current with web development and design. We did the same thing 4 years back, dropped tables for everything (layout and tabular data). I have spent agonizing hours trying to recreate a table from a ton of divs, just not to have a table.

    We have stopped that practice. Working with clients that has more tabular data caused us to reconsider, especially when the client was going to edit the data.

    And that brings me to Zen Cart. Zen Cart's design layout is created with CSS. Their tabular data (product, price ect) is done with tables. I have been working creating new templates for our clients and its amazing what you can do with design while leaving the tables in there.

    Just my 2 cents.

  9. #9
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    Yeah, I guess I could leave the tables in. One of my EZPages actually has a table in it, too. I'm just trying lately to be a good girl and not use tables for layout. It would be a major pain in the ######## to switch.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: I'm going to try to convert my site layout from tables to CSS... anyone have tips

    I am totally supportive of not using new tables for layout of non-tabular data. You SHOULD leave the tables for product listings and the like (unless you want a non-tabular layout for them) because they really ARE tables and the <table> markup is meaningful.

 

 

Similar Threads

  1. Anyone know what is going on with my site?
    By sfklaas in forum General Questions
    Replies: 1
    Last Post: 1 May 2008, 02:49 AM
  2. Replies: 0
    Last Post: 28 Aug 2007, 09:25 PM
  3. Convert db tables from Oscommerce
    By HDG in forum General Questions
    Replies: 3
    Last Post: 30 Jul 2007, 08:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg