HTML
  Home arrow HTML arrow Page 4 - Learn to Use HTML Tables and DIV tags Quic...
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  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
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? 
HTML

Learn to Use HTML Tables and DIV tags Quickly
By: Stephen Davies
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 24
    2007-11-21

    Table of Contents:
  • Learn to Use HTML Tables and DIV tags Quickly
  • Use of Table Style
  • The Use of the DIV tag
  • Combining the use of DIV and TABLE tags

  • 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


    Learn to Use HTML Tables and DIV tags Quickly - Combining the use of DIV and TABLE tags


    (Page 4 of 4 )

    So, as we have discussed here, the <DIV> tag is similar to the table tag in terms of how it can aid design composition on a web page. There is also a way to combine the usage of both TABLE and DIV tags. This example shows how they can be combined.

    A style sheet should be used to apply the table properties and the DIV tags should be used to compose the page. Let us apply this to the code for a simple example:

    <div id="Main Page">

    <div id="row one">


    <div id="left col">

    <h4>Left Column</h4>

    <p> Place any text here..</p>

    </div>


    <div id="center">

    <h4>Center Column</h4>

    <p> Place any text here..</</p>

    </div>


    <div id="right col">

    <h4>Right Column</h4>

    <p> Place any text here..</</p>

    </div>


    </div>

    </div>


    The DIV tag will follow the usual table rules and apply the styles below to display the table:

    #Main Page {

    display: table;

    }


    #row one {

    display: table-row;

    }


    #left col, #center, #right col {

    display: table-cell;

    }

    What is happening is a table simulation using DIV tags. The cell properties that are inherited by the table are in the style sheet above. This can be done quite erratically if not done properly, though the same principles apply when coding a style sheet to define the table cell properties.

    The only browser where problems seem to occur is IE6. It seems Firefox and Opera are okay. When embedding any data inside the DIV container, the rows may not appear correctly once a lot of cells are added. If you do this carefully, though, it should work in all browsers.

    That concludes this article. Once you get used to using styles with DIV tags in this way, you will move away from just plain TABLE tags eventually and create many nice front pages. Go on, DIV it up.


    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.

       · Doesn't work as presented, and the random beginner who knows enough to fix it...
       · bit negative.... which part does not work exactly?? tests showed it work, please...
     

    HTML ARTICLES

    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset
    - Building Single Row Database Forms with HTML
    - Introduction to Database Forms with HTML
    - Another Look at Animation of Geographical Ma...
    - Animation of Geographical Map Regions
    - Changing and Moving Pictures with CSS
    - Clickable Geographical Map Regions
    - Gradient Creation with the HR Element
    - Text on HTML Images: Do it Yourself
    - Custom Buttons in HTML
    - Quick Web Page Menu







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway