Tables

Tables are a great way to organize information, so HTML has the <table> tag.

A table is started and ended with the <table> and </table> tags.

Within the table, each row is started with the <tr> tag and ended with the </tr> tag.

Within the row, each cell is started with the <td> tag (stands for table "data") and ended with the </td> tag.

Special header rows (bold and centered) use the <th> and </th> tags.

<rowspan="number of rows"> and <colspan="number of columns"> can be used to "combine" rows and columns.

A <table> tag can have various attributes, including width (in percent of window or in pixels), border (size, type, and color), padding between the contents and the border (in pixels), text alignment (text-align: center), and many others. Once we discuss CSS, this styling is typically done there instead.