SEARCH OUR SITE
HOME TUTORIALS RESOURCES SEARCH ABOUT US CONTACT US HELP
 Guide to Learning HTML - Tutorial - Tables
Tables
Tables are one of the most functional thing in HTML and can be used to create a spectrum of effects and layout control.

Basic table
Tables start and end with the <table> tag.
The number of TD elements in a given row defines the number of columns in the table, while the number of TR elements defines the number of rows.
Here is an exmple:
<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</table>
A simple table
Cell 1 Cell 2
Cell 3 Cell 4

The most popular attributes for the <table> tags:
 Attribute  Description
border The border thickness in pixels.
bgcolor Specifies the background color of the Table in Hex or RGB triplet.
width Width of overall Table in pixels or percent.
cellpadding Pixels between the cell data and cell wall.
cellspacing Pixels between cells.

<table border=0>
Cell 1 Cell 2
Cell 3 Cell 4
<table bgcolor=lightblue>
Cell 1 Cell 2
Cell 3 Cell 4
<table width=200>
Cell 1 Cell 2
Cell 3 Cell 4
<table cellpadding=4>
Cell 1 Cell 2
Cell 3 Cell 4
<table cellspacing=4>
Cell 1 Cell 2
Cell 3 Cell 4

More Complicated Table
After combing all these properties, you can get a more complicated table.
<table border=4 bgcolor=lightblue width=200 cellspacing=4 cellpadding=4>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</table>
Cell 1 Cell 2
Cell 3 Cell 4


Choose a topic
 Basic HTML
  - Basic
  - Background
  - Links
  - Images
 Intermediate HTML
  - Font Size
  - Text
  - Lists
  - Background Music
 Advanced HTML
  - Tables
  - Frames
  - Meta Tag
 Quick Reference
  - HTML Tags
  - Special Characters
 Location: /28461/tables.htm
PREVIOUS PAGE NEXT PAGE

| Home | Tutorials | Resources | Search | About Us | Contact Us | Help |


This web site is best viewed with 800 x 600 High Color,
Internet Explorer 4.0 or Netscape 4.0 or later versions.
This entire site, except for licensed resources,
Copyright © 1999 by Team28461 All rights reserved.