Home arrow Style Sheets arrow Page 3 - Building a Three-Column Web Page Layout with DIV-Based CSS Tables
STYLE SHEETS

Building a Three-Column Web Page Layout with DIV-Based CSS Tables


DIV-based CSS tables deserve more usage than they receive; Microsoft's web browser doesn't support them, which may explain why they're not more popular. That looks set to change with IE 8, however. To help you keep up with the times, this four-part article series shows you how to build CSS tables. This second part of the series demonstrates how to use CSS tables to build a typical three-column web page.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
January 06, 2009
TABLE OF CONTENTS:
  1. · Building a Three-Column Web Page Layout with DIV-Based CSS Tables
  2. · Review: a two-column liquid design with CSS tables
  3. · Building a three-column web page layout with CSS tables
  4. · Finishing the three-column web page layout

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

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.


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials