An Introduction to Tables


ALIGN: can be set to 'left', 'right' or 'center'. Sets the alignment of the entire table in the browser window. Default: center
WIDTH: can be set as a percentage of the browser window or as a definite number of pixels . Default: [as required]
HEIGHT: sets in pixels the height of the table. Default: [as required]

These are the attributes of the <tr> tag:
BGCOLOR: sets a background colour as discussed in a previous article. Default: #FFFFFF (white)
ALIGN: can be set to 'left', 'right' or 'center'. Sets the alignment of the text in each cell of that row. Default: 'left'

These are the attributes of the <td> tag:
BGCOLOR: sets a background colour as discussed in a previous article. Default: #FFFFFF (white)
ALIGN: can be set to 'left', 'right' or 'center'. Sets the alignment of the text in that cell. Default: 'left'
BACKGROUND: sets a background image. Default: none
WIDTH: can be set as a percentage or as a definite number of pixels . Default: [as required]
HEIGHT: sets in pixels the height of the cell. Default: [as required]

These are the basic structural attributes. None of them are required and if not included there values are assumed to be the defaults I have mentioned above.

It is not always necessary for each cell to contain data. If you want a cell to contain no data and to still present properly you should put a <br> tag or the non-breaking space character (&nbsp) into it:

<td><br></td>
or <td>&nbsp</td>

Next month I will discuss more attributes relating to colour and more structural attributes also. I will also in another article discuss practical uses for tables.

If you want to read my other complete html tutorial on tables go to http://www.geocities.com/~letslearnhtml/...

Oisin Prendiville

The copyright of the article An Introduction to Tables in HTML Lessons is owned by Oisin Prendiville. Permission to republish An Introduction to Tables in print or online must be granted by the author in writing.

Go To Page: 1 2

Articles in this Topic    Discussions in this Topic