HTML Tables

  • HTML Tables are not to be used for building layouts.
  • Instead, they are to display tabular data like a schedule or timetable or spreadsheet.
  • The tags used in tables include:
    • <table> - the table container
    • <tbody> - the body of the table
    • <thead> - the header area of the table
    • <tr> - table row
    • <th> - table heading cell
    • <td> - table data cell (most common tag)
    • <col> - column definition used inside the table at the top
    • <colgroup> - group of columns
    • <caption> - the label/description for a table
  • Here is a sample table
<table>
  <caption>
    This is the label for the table
  </caption>
  <thead>
    <tr>
      <th>Mon</th>
      <th>Tue</th>
      <th>Wed</th>
      <th>Thu</th>
      <th>Fri</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>-</td>
      <td>MAD9012</td>
      <td>-</td>
      <td>MAD9116</td>
      <td>-</td>
    </tr>
    <tr>
      <td>MAD9100</td>
      <td>-</td>
      <td>-</td>
      <td>-</td>
      <td>MAD9100</td>
    </tr>
    <tr>
      <td>-</td>
      <td>MAD9015</td>
      <td>MAD9015</td>
      <td>-</td>
      <td>-</td>
    </tr>
  </tbody>
</table>
Last Updated: : 8/26/2019, 3:00:46 PM