Show List

HTML Tables

HTML tables are used to present data in a tabular format, with rows and columns. They are useful for displaying large amounts of structured data and for organizing information in a clear and concise manner.

The basic structure of an HTML table consists of the following elements:

  • <table>: The main container for the table.
  • <tr>: Defines a table row.
  • <th>: Defines a table header cell, used to provide a label for the rest of the cells in the column.
  • <td>: Defines a table data cell, which contains the actual data for the table.

Here is an example of a simple HTML table:

<table>
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
    <th>Header 3</th>
  </tr>
  <tr>
    <td>Row 1, Column 1</td>
    <td>Row 1, Column 2</td>
    <td>Row 1, Column 3</td>
  </tr>
  <tr>
    <td>Row 2, Column 1</td>
    <td>Row 2, Column 2</td>
    <td>Row 2, Column 3</td>
  </tr>
</table>
This table would be displayed as:

Header 1Header 2Header 3
Row 1, Column 1Row 1, Column 2Row 1, Column 3
Row 2, Column 1Row 2, Column 2Row 2, Column 3


Next: HTML forms


    Leave a Comment


  • captcha text