Home arrow Style Sheets arrow Page 2 - Adding Headers and Footers with DIV-Based CSS Tables
STYLE SHEETS

Adding Headers and Footers with DIV-Based CSS Tables


Welcome to the concluding article of a four-part series on creating DIV-based CSS tables. In previous parts, you learned how to construct some basic web page layouts made up of two and three columns with the help of CSS tables. In this article, you will learn how to add header and footer sections to these layouts.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
January 21, 2009
TABLE OF CONTENTS:
  1. · Adding Headers and Footers with DIV-Based CSS Tables
  2. · Adding header and footer sections to a two-column web page layout: a traditional CSS approach
  3. · Structural markup for the two-column web page design
  4. · Adding a header and a footer to an existing three-column web page layout

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Adding Headers and Footers with DIV-Based CSS Tables - Adding header and footer sections to a two-column web page layout: a traditional CSS approach
(Page 2 of 4 )

To be frank, adding a header and a footer section to an existing two-column web page layout is a pretty simple process that can be tackled with minor hassles. Essentially, the procedure requires only coding a couple of additional divs on the top and the bottom of the web document, and that’s all.

Undoubtedly, you'll understand this process better if you examine the following CSS code:


#tablewrapper{

border-collapse: collapse;

display: table;

table-layout: fixed;

}

#maincol, #sidebar{

display: table-cell;

}

#header{

padding: 10px;

background: #ffc;

}

#maincol{

width: 70%;

padding: 10px;

}

#sidebar{

width: 30%;

padding: 10px;

background: #eee;

}

#footer{

padding: 10px;

background: #ffc;

}


As you can see, all I did was add a pair of extra divs, identified as “header” and “footer” respectively, to the existing columns of the web document, where they will be rendered as cells of a typical HTML table. Not too difficult to grasp, right?

Now that you hopefully grasped how to incorporate header and footer sections into a previous web page layout composed of two main columns, it’s time to see how the CSS styles coded previously can be linked to the structural markup of the web page.

This interesting process will be shown in detail in the section to come, so if you want to learn more about it, please click on the link that appears below and keep reading.


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 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials