Style Sheets
  Home arrow Style Sheets arrow Page 4 - Styling Headers, Paragraphs and Main Colum...
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

Styling Headers, Paragraphs and Main Columns of DIV-Based CSS Tables
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2009-01-13

    Table of Contents:
  • Styling Headers, Paragraphs and Main Columns of DIV-Based CSS Tables
  • Review: building a basic three-column web page layout with CSS tables
  • Styling main divs, paragraphs, and headers
  • The complete source code of the three-column web page

  • 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


    Styling Headers, Paragraphs and Main Columns of DIV-Based CSS Tables - The complete source code of the three-column web page


    (Page 4 of 4 )

    As I anticipated in the previous section, below I included the complete source code of the web page built in the beginning, this time incorporating the additional CSS styles created before. Here it is:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    <title>Example of div-based web page layout using CSS tables (some elements are basically styled)</title>

    <style type="text/css">

    body{

    padding: 0;

    margin: 0;

    background: #fff;

    }

    h2{

    margin: 0;

    font: bold 14pt Arial, Helvetica, sans-serif;

    color: #036;

    }

    p{

    font: normal 11px Tahoma, Arial, Helvetica, sans-serif;

    color: #333;

    }

    #tablewrapper{

    border-collapse: collapse;

    display: table;

    table-layout: fixed;

    }

    #navbar, #maincol, #sidebar{

    display: table-cell;

    }

    #navbar{

    width: 20%;

    padding: 15px;

    background: #ccf;

    }

    #maincol{

    width: 50%;

    padding: 15px;

    background: #eee;

    }

    #sidebar{

    width: 30%;

    padding: 15px;

    background: #9cf;

    }

    </style>

    </head>

    <body>

    <div id="tablewrapper">

    <div id="navbar">

    <h2>This is the left column of the web page</h2>

    <p>Contents for left column go here. Contents for left column go here. Contents for left column go here. Contents for left column go here. Contents for left column go here. Contents for left column go here. Contents for left column go here. Contents for left column go here. Contents for left column go here. Contents for left column go here.</p>

    </div>

    <div id="maincol">

    <h2>This is the center column of the web page</h2>

    <p>Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here.</p>

    <p>Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here.</p>

    <p>Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here. Contents for center column go here.</p>

    </div>

    <div id="sidebar">

    <h2>This is the right column of the web page</h2>

    <p>Contents for right column go here. Contents for right column go here. Contents for right column go here. Contents for right column go here. Contents for right column go here.</p>

    <p>Contents for right column go here. Contents for right column go here. Contents for right column go here. Contents for right column go here. Contents for right column go here.</p>

    <p>Contents for right column go here. Contents for right column go here. Contents for right column go here. Contents for right column go here. Contents for right column go here.</p>

    </div>

    </div>

    </body>

    </html>


    A final reminder before you finish reading this tutorial: if you’re planning to test the above example on your own machine, don’t forget that it won’t work with Internet Explorer 7 and below, since it lacks  adequate support for CSS tables. Naturally, Mozilla Firefox and other standards-compliant browsers will render the tables as expected.

    Final thoughts

    In this third part of the series, I demonstrated how to improve, at a basic level, the visual appearance of the previous web page, which was created with CSS tables. Obviously, this process is very simple to grasp, and doesn’t require additional explanation.

    However, it’s possible that at this moment you’re wondering how to add a header and a footer sections to the web page. That’s a good question, but if you want to know the answer, you’ll have to read the upcoming article!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · In this third installment of the series, I’ll demonstrate how to polish the look and...
       · It took four pages to add a color spec to a <p> and three <div> tags??? Seems like...
       · Thanks for commenting. Well, that’s only your opinion which is naturally always...
     

    STYLE SHEETS ARTICLES

    - Building Rounded Corners with CSS3`s -webkit...
    - Using the Custom -moz-border-radius Property...
    - Using CSS3`s Border-Radius Property to Build...
    - Adding Semantic Meaning to Styled Code Block...
    - Styling Code blocks with CSS: Using pre HTML...
    - Building Rounded Corners with CSS3
    - Finishing a Casual Navigation Bar with CSS S...
    - Defining a Navigation Bar`s Hover State with...
    - Styling a Blog`s Links Bar with CSS Sprites
    - Creating an Artistic Blog Header with CSS Sp...
    - Defining the Active State of Menu Sections f...
    - Styling the Hover State of a CSS Sprite-Base...
    - Building CSS Sprite-Based Navigation Bars
    - Creating Framed Pictures with CSS
    - Using a CSS Shading Effect to Decorate Images







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