Site hosted by Angelfire.com: Build your free website today!

Tables

HomeCSSTablesImagesTypographyLayoutDevices
Color TheoryFormsResourcesDreamweaver FeaturesAccessibilityMultimedia

A table contains a header row, columns, and data rows. Tables are used to structure tabular data.

The 'table' element defines the table. The 'th' element defines the table header row. The 'tr' element defines the table row. The 'td' element defines the table data in each cell. These must be enclosed in 'tr' tags.

If you imagine a 3x4 table, which is 12 cells, there should be four 'tr' elements to define the rows and three 'td' elements within each of the rows, making a total of 12 'td' elements.

Tables make it easy for visually impaired visitors to your site by defining the table header row, which is different than a regular table cell.

Table Tags
Tag
Use
<table> The <table> tag determines the start and end of a table. You can specify the entire width of the table, whether the table has a border, and the spacing to place between the table cells.
<caption>

The <caption> tag places a text heading above the table, which labels the table for reference. For instance, a table containing a third-quarter financial report might have a caption of Q3 Financials.

<tr> The <tr> tag defines the start and end of a table row.
<th> The <th> tag defines a table header, which acts as a label for a group of table cells, whether they're in a row or a column.
<td> The <tb> tag defines a standard table cell.