HTML Encyclopaedia

The table tag

The HTML element
<table>
is a container tag used to define a table.

It has a number of attributes of which the commonest are

The basic attributes are illustrated with the following examples.

The first example is a "borderless" table. By not using the border attribute no "frame" is drawn. This is often quite useful.

cell 11cell 12
cell 21cell 22
cell 31cell 32

The second example shows the same table with the border attribute set to 5.

cell 11cell 12
cell 21cell 22
cell 31cell 32

The third example sets the cellspacing attribute to 10 and the border attribute to 15

cell 11cell 12
cell 21cell 22
cell 31cell 32

And here's the same with cellpadding set to 10 and the border attribute set to 5

cell 11cell 12
cell 21cell 22
cell 31cell 32

The next example shows right alignment

cell 11cell 12
cell 21cell 22
cell 31cell 32


And finally just for IE users, a table with a yellow border. This table is also has the align attribute set to center.

cell 11cell 12
cell 21cell 22
cell 31cell 32

Browsers
Only IE, ARA and NN4 honoured the bordercolor attribute. NN3 and IE did not honour align=center. NN4 honoured align=center All browsers showed tables with 3-D effect borders, this is a user-controllable option in MOS3. Only IE understood the rules, frame, bordercolorlight and bordercolordark attributes.


See also <td>, <tr>, <th> and the general notes on tables.