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  
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? 
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 / 40
    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


    (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...
       · I must be missing something. How can you explain how to use divs and tables...
       · I tried the examples; cut-and-paste added some erroneus < and so on.I ended...
       · hi it seems that you forgot to add _ at the id .. i tried copy paste your script...
     

    HTML ARTICLES

    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP
    - Background Images for a Menu for All Browsers
    - React and ToChoose Functions for a Menu for ...
    - Fast FAQ Session with ACP
    - Functions for a Menu for All Browsers
    - Browser Compatibility Modifications for a We...
    - Building a Drop-Down Menu with Nested HTML L...
    - Table Attributes for a Menu for all Browsers
    - Modifying a Web Page Calendar
    - Styling Elements of Nested HTML Lists
    - Configuring Tables for a Menu for All Browse...
    - Showing a Full Year with a Web Page Calendar
    - Designing with Nested HTML Lists







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT