Tables in HTML

 Tables in HTML


Tables are used to display data in a grid format. HTML provides several elements for creating tables, including:


<table> for creating the table itself

<tr> for creating rows in the table

<th> for creating header cells in the table

<td> for creating data cells in the table

Here's an example of a simple table:


html


<table>

  <thead>

    <tr>

      <th>Name</th>

      <th>Email</th>

      <th>Phone</th>

    </tr>

  </thead>

  <tbody>

    <tr>

      <td>John Doe</td>

      <td>john@example.com</td>

      <td>555-1234</td>

    </tr>

    <tr>

      <td>Jane Smith</td>

      <td>jane@example.com</td>

      <td>555-5678</td>

    </tr>

  </tbody>

</table>

This table has a header row with three columns for Name, Email, and Phone, and two data rows with information about two people.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...