ADVERTISEMENT
Google AdSense Slot (headerLeaderboard)
Set your Publisher ID in src/config/ads.ts to display live ads.
HTML5 Tutorial• 5 min read
HTML Tables
Create structured grid data with rows, columns, and headers
HTML tables allow web developers to arrange data like text, images, and links into rows and columns of cells.
Table Structure Tags
An HTML table is defined with the <table> tag.
Each table row is defined with a <tr> tag.
Each table header is defined with a <th> tag (bold and centered by default).
Each table data/cell is defined with a <td> tag.
Interactive HTML Table Example
<table border="1" cellpadding="8" style="border-collapse: collapse; width: 100%; text-align: left;">
<thead style="background-color: #04AA6D; color: white;">
<tr>
<th>Student</th>
<th>Track</th>
<th>Grade</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alex Chen</td>
<td>Full Stack Web</td>
<td>A+</td>
</tr>
<tr style="background-color: #f9f9f9;">
<td>Sarah Miller</td>
<td>Python & SQL</td>
<td>A</td>
</tr>
<tr>
<td>Devon King</td>
<td>Frontend React</td>
<td>A+</td>
</tr>
</tbody>
</table>ADVERTISEMENT
Google AdSense Slot (inContentBanner)
Set your Publisher ID in src/config/ads.ts to display live ads.
Test Yourself With Exercise
Which tag is used to create a table cell containing regular data?