Intro To HTML Tables
Intro To HTML Tables
Tables
Tables are used to distribute HTML objects (text, graphics) in columns and rows. Example:
Visitors of the web site Month Page requests Sessions January 24.000 8.000
Table definition
To define a table you must:
Insert the table object: <TABLE Table_attributes> </TABLE> Specify the rows of the table: <TR> </TR> Specify the cells of each row and its contents: <TD Cell_attributes> Cell contents </TD>
Table definition
<TABLE BORDER=1> <TR> <TD>1</TD> First row <TD>2</TD> <TD>3</TD> </TR> </TABLE>
1 4 7
2 5 8
3 6 9
Table attributes
Border=n, where n is 0 or a positive number. When n is 0, no border is drawn. In any other case, the outer border of the table has a width of n. Cell borders are always thin. BorderColor=color, where color is a color name or number. It determines the color of the table and cell borders.
Table attributes
CellPadding=n, where n is 0 or a positive number. This is the amount of space between cell borders and the contents of cells. CellSpacing=n, where n is 0 or a positive number. This is the amount of space between cells of a table.
Table attributes
Align=s, where s is left, center or right. It determines the alignment of the table. BgColor=color, where color is a color name or number. When specified, the table background has this color.
Cell grouping
Consecutive cells in a row can be grouped. Consecutive cells in a column can be grouped. A rectangular block of cells can be grouped.