SunQuest
 
       HTML
  Home arrow HTML arrow 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  
Actuate Whitepapers 
Moblin 
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 / 23
    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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Learn to Use HTML Tables and DIV tags Quickly


    (Page 1 of 4 )

    Tables have always been popular for simplifying the layout of information on web pages. Style sheets, however, are replacing the idea of a tabulated format. Tables are still popular, though, as they present a very popular layout for design-friendly interfaces. So the need for some kind of combination between plain table tags and styles has arisen.

    Introduction

    Content is easily readable in a tabular form. Most web sites that use tables are seen to be very smooth in appearance. For those who want to know a little more about tables and how they can be complemented by <STYLE> and <DIV> tags to quickly create a web page, here goes.

    First, let me give you a little overview of table usage that is still popular among designers today with or without the use of style sheets. The main reason for this is spacing. Composition is always a problem among novice designers and can be hard on the eye if not corrected.

    <table border="1">

    <tr>

    <td>row 1, cell 1</td>

    <td>row 1, cell 2</td>

    </tr>

    <tr>

    <td>row 2, cell 1</td>

    <td>row 2, cell 2</td>

    </tr>

    </table>

    This is a typical example of a 2x2 table, rows by columns. The tables themselves can become as complex as the coder requires. Tabulated sheets can become quite intricate using tables alone.

    Here is an example of the above table with no border:

    <html>

    <body>

    <h4>This table has no borders:</h4>

    <table>

    <tr>

    <td>100</td>

    <td>200</td>

    <td>300</td>

    </tr>

    <tr>

    <td>400</td>

    <td>500</td>

    <td>600</td>

    </tr>

    </table>

    </html>


    The spacing in the table cells can be padded out as required, if we insert the line - border="1" cellpadding="10" - into the <TABLE> tag like this:

    <table border="1" cellpadding="10" >

    <tr>

    <td>row 1, cell 1</td>

    <td>row 1, cell 2</td>

    </tr>

    <tr>

    <td>row 2, cell 1</td>

    <td>row 2, cell 2</td>

    </tr>

    </table>



    The cellpadding element can be customized according to your needs. What normally happens is once the table has been designed like this into a tabular form, those cells can begin to take shape. Look at this simple table web site plan for example. With the style sheets to one side, there is left-right design here with data in the center and down the right. Here is a standard table with 3 rows and 3 columns:

    LOGO

    HERE

    BANNER ADVERTISING COMPANY SERVICES THROUGH AN ANIMATED GIF OR FLASH HEADER

    DATE



    MENU ITEMS


    CONTENT

    here is the code for this 3x3 table:


    <table border="1" cellpadding="10" >

    <tr>

    <td> LOGO HERE </td>

    <td> BANNER ADVERTISING COMPANY SERVICES THROUGH AN ANIMATED GIF OR FLASH HEADER </td>

    <td>DATE</td>

    </tr>

    <tr>

    <td>MENU ITEMS</td>

    <td>CONTENT</td>

    <td>ADS</td>

    </tr>

    <tr>

    <td>OTHER MENU ITEMS</td>

    <td>CONTENT</td>

    <td>ADS</td>

    </tr>

    </table>






    ADS

    OTHER MENU ITEMS


    CONTENT

    ADS



    This is a pretty generic view but illustrates how important table design is for composition of web page elements. It can be made to be much more intricate but this shows how a table is used to design a web page. It is shows how the placement of images, menus and content can be planned.

    Cell spacing can add some nice composition to the page. It will increase the spacing between each cell. Here are the cells spaced out using the above code:

    <table border="1" cellspacing="10">

    <tr>

    <td></td>

    <td></td>

    </tr>

    <tr>

    <td></td>

    <td></td>

    </tr>

    </table>

    If no border is required, simply change the border=1 to border="0". Tables allow for smooth composition results.

    In the next section I will give you some tips on using tables.

    More HTML Articles
    More By Stephen Davies


       · 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

    - 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
    - Maximizing and Restoring HTML Images with th...
    - Maximizing and Restoring HTML Images with th...
    - Handling Hyperlinks and Images in HTML







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