HTML Tables
HTML
<table border="1" cellpadding="6" style="border-collapse: collapse">
<caption>Semester Results</caption>
<thead>
<tr><th>Roll</th><th>Name</th><th>Marks</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Asha</td><td>88</td></tr>
<tr><td>2</td><td>Ravi</td><td>76</td></tr>
</tbody>
<tfoot>
<tr><td colspan="2">Average</td><td>82</td></tr>
</tfoot>
</table>
Semester Results
| Roll | Name | Marks |
| 1 | Asha | 88 |
| 2 | Ravi | 76 |
| Average | 82 |
| Tag / attribute | Meaning |
| <tr> | Table row |
| <th> / <td> | Header cell / data cell |
| <thead>, <tbody>, <tfoot> | Group rows into sections |
| colspan / rowspan | Merge cells across columns / rows |
rowspan Example
HTML
<table border="1" cellpadding="6" style="border-collapse: collapse">
<tr><th>Day</th><th>Time</th><th>Subject</th></tr>
<tr><td rowspan="2">Monday</td><td>10:00</td><td>TOC</td></tr>
<tr><td>11:00</td><td>DBMS</td></tr>
</table>
| Day | Time | Subject |
| Monday | 10:00 | TOC |
| 11:00 | DBMS |
Track your progress through the HTML course