Style Sheets
  Home arrow Style Sheets arrow Page 3 - Building a Three-Column Web Page Layout wi...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Building a Three-Column Web Page Layout with DIV-Based CSS Tables
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2009-01-06

    Table of Contents:
  • Building a Three-Column Web Page Layout with DIV-Based CSS Tables
  • Review: a two-column liquid design with CSS tables
  • Building a three-column web page layout with CSS tables
  • Finishing the three-column web page layout

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building a Three-Column Web Page Layout with DIV-Based CSS Tables - Building a three-column web page layout with CSS tables


    (Page 3 of 4 )

    Using CSS tables for constructing a web page layout composed of three primary columns is actually a no-brainer process. The whole creation process is very similar to the approach that I used in the previous section.

    In simple terms, apart from defining the CSS selectors corresponding to each main column of the web document, the only additional step that must be performed consists of specifying, via the “display” CSS property, that each of these columns must be displayed as normal table cells.

    Based on this concept, below I created the CSS styles that construct the aforementioned three-column web page design. Here they are:

    #navbar, #maincol, #sidebar{

    display: table-cell;

    }

    #tablewrapper{

    border-collapse: collapse;

    display: table;

    table-layout: fixed;

    }

    #navbar{

    width: 500px;

    padding: 10px;

    background: #eee;

    }

    #maincol{

    width: 50%;

    padding: 10px;

    }

    #sidebar{

    width: 30%;

    padding: 10px;

    background: #eee;

    }


    See how easy it is to build a web page design composed of three columns, with the assistance of CSS tables? I bet you do! As shown above, the columns will be rendered as cells of a regular HTML table, in accordance with the following declaration:


    #navbar, #maincol, #sidebar{

    display: table-cell;

    }


    Other than that, the rest of the CSS styles declared above are fairly easy to follow, so I’m not going to waste your time explaining how they work. However, as you may guess, it’s necessary to tie the previous set of CSS styles to the corresponding markup of the web document; this way, you’ll quickly grasp how these two layers can be linked.

    Thus, if you’re interested in seeing the full source code that renders this three-column web page layout, then read the following section.

    More Style Sheets Articles
    More By Alejandro Gervasio


       · Over the first part of this series, I provided a quick introduction to using...
     

    STYLE SHEETS ARTICLES

    - Image Replacement CSS Techniques
    - Using BlueTrip`s Success, Notice and Error C...
    - More Uses for the Thin and Caps CSS Classes ...
    - Styling Definition Lists with the BlueTrip C...
    - Styling Unordered and Ordered HTML Lists wit...
    - Using the BlueTrip CSS Framework`s Thin and ...
    - Adding Borders to Web Page Columns with Blue...
    - Introducing the BlueTrip CSS Framework
    - Using a Background Grid to Assist Web Page L...
    - Extending the Rule Of Thirds for Web Page La...
    - A Two-Column Web Page Layout Based on the Ru...
    - Using the Rule Of Thirds for Web Page Layout
    - Swapping Columns Using the Divine Ratio for ...
    - Using the Golden Ratio in Liquid Web Page De...
    - Fundamental Design Principles for Web Page L...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek