What is Table Tag in html ?
Use of table tag in html:
Imagine you’re setting up a fancy dinner party, and
you need to organize all your guests. HTML tables are like your seating chart,
making sure everyone knows where to sit.
Here’s a basic example to get you started:
<h1>Welcome to the Table Extravaganza!</h1>
<table>
<tr>
<th>Name</th>
<th>Favorite Food</th>
</tr>
<tr>
<td>John</td>
<td>Pizza</td>
</tr>
<tr>
<td>Jane</td>
<td>Sushi</td>
</tr>
</table>
</body>
Here’s a basic example to get you started:
<h1>Welcome to the Table Extravaganza!</h1>
<table>
<tr>
<th>Name</th>
<th>Favorite Food</th>
</tr>
<tr>
<td>John</td>
<td>Pizza</td>
</tr>
<tr>
<td>Jane</td>
<td>Sushi</td>
</tr>
</table>
</body>
Breaking it Down:
<table border="1">: This is your table tag, the grandmaster of the dinner party. The border="1" attribute adds a border to your table, making it look neat and tidy.
<tr>: Think of this as a row
in your table. Each row can have multiple cells.
<th>: This stands for “table
header.” It’s like the VIP section of your table, usually bold and centered.
<td>: This stands for “table
data.” These are the regular seats where your guests (data) sit.
So, in our example, we have a table with two columns: “Name”
and “Favorite Food.” John loves pizza, and Jane is all about sushi.

Comments
Post a Comment