Tables

A table is used to organize data in a neat and readable fashion. They are commonly used in layouts to help position text and images. A table consists of the table, tr, and td tags.

<table>

  <tr>
    <td> Row 1, Cell 1 </td>
    <td> Row 1, Cell 2 </td>
  </tr>

  <tr>
    <td> Row 2, Cell 1 </td>
    <td> Row 2, Cell 2 </td>
  </tr>

  <tr>
    <td> Row 3, Cell 1 </td>
    <td> Row 3, Cell 2 </td>
  </tr>

</table>

The table tag defines the table itself and its boundaries.

The tr tag defines a row within the table. (table row) The tr tag can only be used within a table tag.

The td tag defines a cell of data within a row of a table. (table data) A td tag can only be used within a tr tag. The data or text goes with the td tag.