[click to go to previous page] [to index page] [to next page]

2 : Basic Table Elements

previous page Let's begin with the basic elements of a table and their corresponding terminology in HTML.
A table is made up of horizontal rows and vertical columns:

Table 1
Row 1, Column 1 Row 1, Column 2 Row 1, Column 3
Row 2, Column 1 Row 2, Column 2 Row 2, Column 3
Row 3, Column 1 Row 3, Column 2 Row 3, Column 3

In HTML you lay out a table by creating each row, called "table rows" and then dividing that row into columns, called "table data."
Here's the code for the above table:

Table 1 Code
<table align=center border=2>
    <td>Row 1, Column 1</td>
    <td>Row 1, Column 2</td>
    <td>Row 1, Column 3</td>
    <td>Row 2, Column 1</td>
    <td>Row 2, Column 2</td>
    <td>Row 2, Column 3</td>
    <td>Row 3, Column 1</td>
    <td>Row 3, Column 2</td>
    <td>Row 3, Column 3</td>

You can see the basic elements in this code:
  • There are opening and closing <table> tags.
  • There are three table rows, indicated by opening and closing <tr> tags.
  • Each row has three cells, which make up the "columns," indicated by opening and closing <td> tags ("td" stands for "table data").
You are probably noticing the two attributes in the opening <table> tag; the align attribute positions the table horizontally, and the border attribute puts the visible border around the table cells. (More on these attributes later.)
[click to go to previous page] [to index page] [to top of this page] [to next page]

Copyrightę 1998. Liberty Miller . All rights reserved.
This material may not be reproduced without the written permission of the author.

Page 2