The main purpose of tables is to represent data in tabular form. But this is not
the only purpose of tables. You can see, if you look at the HTML code of this or other pages, that
they very often use tables for web page layout. We'll start with defining the table.
To create a table we use the <TABLE> element. It has a start and end tag </TABLE>
The content of the table element are:
CAPTION, TR, TD, THEAD, TFOOT, TBODY, COL, COLGROUP.
We first take a look at the attributes of the <TABLE> element.
cellpadding This represents the amount of white space between the content of a
cell and its border.
cellspacing This is the amount of white space between cells and between
cells and the outside borders of the table.
border This is the width in pixels of the frame around the table.
width Represents the width of the table in pixels or as a percentage of the window
(very useful if you want to display the content of the table in the entire window).
summary Use the summary attribute to give a short summary of the table for
speech synthesizing browsers.
frame The sides of the border of the table that are visible. The frame
attribute takes on eight values:
void No sides. This is the default value.
above The top side only.
below The bottom side only.
hsides The top and bottom sides only.
vsides The left and right sides only.
lhs The left-hand side only.
rhs The right-hand side only.
border or box All for sides.
rules The rules that appear between cells. The rules attribute takes
one of the following values:
none No rules. This is the default value.
groups Rules appear between row groups and column groups only.
rows Rules appear between rows only.
cols Rules appear between columns only.
all Rules appear between all rows and columns.