SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: CSS or tables?

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2011
    Location
    delhi, India
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS or tables?

    Is CSS really a better way to design a website than a tables. Can i work on css in graphic user interface format like tables.

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2012
    Location
    Scarborough, North Yorkshire, United Kingdom
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes it is, using tables is avery old fashioned away of laying out a webpage. CSS is much more flexible and you will get more control over your layout. In addition to that tables don't always print well, take longer to load and aren't great for accessibility.

    Tables still have their place, just not when laying out an entire page.
    Richard
    Resell SSL Certificates - API / WHMCS / HostBill / ClientExec
    ServerTastic - RapidSSL, Geotrust, Thawte, Symantec, SmarterTools and more

  3. #3
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,838
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by webdesigndelhi View Post
    Is CSS really a better way to design a website than a tables. Can i work on css in graphic user interface format like tables.
    CSS is vastly more powerful and sophisticated than using layout tables. It is perfectly possible to use CSS layouts in a graphical interface, although it does take a bit more effort to set up initially – you need to really understand the design and structure yourself rather than just relying on WYSIWYG tools to create it for you – but that never worked reliably for table-based design anyway, not if you wanted it to work properly on a variety of devices.

  4. #4
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,436
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yes, CSS is a better way than tables, the future is table-less coding by using CSS. But there is no "real-life" or practical benefits of replacing <table> tag with <DIV> tags and using full CSS to display the webpages optimized for the popular browsers. The benefit is that using table-less your code will be more clean and you will be able to "templatize" everything, reusing those css properties.

  5. #5
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,741
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    But there is no "real-life" or practical benefits of replacing <table> tag with <DIV>
    There is, ( for starters you have replaced the SEMANTICALLY incorrect TABLE tag for non tabular data) , still it does waste the potential for a having actually well coded design.

    Can i work on css in graphic user interface format like tables.
    one can do anything if one knows how.

    THE IMPORTANT THING TO KNOW, is that CSS helps you SEPARATE content from layout ( what I assumed you mean by " graphic user interface format". If you are still trying to make the page content dependent on it's layout then you will get it wrong even if using DIVs.

    Create a WELL STRUCTURED HTML document FIRST. Then use CSS to style/display the content as desired.

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by webcosmo View Post
    But there is no "real-life" or practical benefits of replacing <table> tag with <DIV> tags
    You shouldn't be doing that anyway. You should be using the most semantically appropriate tag around each piece of content. In most cases that will not be taboe or div but something else entirely.

    Using divs all over the place in your page only gains minor advantages over using table - both are wrong for most of the same reasons.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,838
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by webcosmo View Post
    Yes, CSS is a better way than tables, the future is table-less coding by using CSS. But there is no "real-life" or practical benefits of replacing <table> tag with <DIV> tags and using full CSS to display the webpages optimized for the popular browsers.
    If that's all you're doing with it then no, there isn't any benefit to it ... because that's not the right way to create a CSS layout. With HTML+CSS, you start with the document structure, and build the visual presentation from there. This gives you much more streamlined code than either layout tables or simply recreating a layout table structure in <div>s. You're missing all the opportunities that CSS has to improve the suitability of your code, to give more flexibility in the way you present the page and to alter the presentation for different devices (eg a different layout for mobiles).


Bookmarks

Posting Permissions

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