HTML Code for Table
a basic example of an HTML table. This table includes headers, rows, and columns. You can customize the content and structure of the table according to your needs.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Table</title>
<style>
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th, td {
border: 1px solid #ddd;
padding: 10px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>25</td>
<td>New York</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>30</td>
<td>San Francisco</td>
</tr>
<tr>
<td>Bob Johnson</td>
<td>22</td>
<td>Los Angeles</td>
</tr>
</tbody>
</table>
</body>
</html>
You can modify the content inside the `<thead>` and `<tbody>` sections to match your data. Additionally, you can adjust the styling properties in the `<style>` section to customize the appearance of the table.
Post a Comment