Subscribe Us

HTML TABLES

HTML Tables: Organizing Data

HTML Tables: Organizing Data

What is an HTML Table?

An HTML table is used to organize data into rows and columns. It is created using the <table> tag, and it consists of various child elements to define the structure.

Table Elements

Here are the main elements used in an HTML table:

  • <table>: Encloses the entire table.
  • <tr>: Defines a row in the table.
  • <th>: Defines a header cell in a table.
  • <td>: Defines a standard cell in a table.

Example: HTML Table

Here’s an example of a simple HTML table:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Table Example</title>
</head>
<body>
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>John</td>
<td>30</td>
<td>New York</td>
</tr>
<tr>
<td>Jane</td>
<td>25</td>
<td>Los Angeles</td>
</tr>
</table>
</body>
</html>

© 2024 HTML Tutorial

No comments