HTML Program with Explanation
This HTML code creates a weekly timetable for a B.Sc. Physics and Computer
Science student using table-related tags like <table>, <thead>, <tbody>,
<tfoot>, <caption>, <th>, and <td>. It also demonstrates the use of rowspan
and colspan to merge table cells.
HTML Code
<!DOCTYPE html>
<html>
<head>
<title>BSc Timetable</title>
</head>
<body>
<!-- Start of Table -->
<table border="1">
<!-- Table caption -->
<caption>B.Sc. Physics & Computer Science -
Weekly Timetable</caption>
<!-- Table header using thead -->
<thead>
<tr>
<th>Day</th>
<th>9:00 - 10:00</th>
<th>10:00 - 11:00</th>
<th>11:00 - 12:00</th>
<th>12:00 - 1:00</th>
<th>1:00 - 2:00</th>
<th>2:00 - 3:00</th>
<th>3:00 - 4:00</th>
</tr>
</thead>
<!-- Table body using tbody -->
<tbody>
<tr>
<td>Monday</td>
<td>Physics</td>
<td>Computer</td>
<td>Maths</td>
<td rowspan="5">Lunch Break</td>
<td>Lab</td>
<td colspan="2">Lab Continued</td>
</tr>
<tr>
<td>Tuesday</td>
<td>English</td>
<td>Physics</td>
<td>Computer</td>
<td>Maths</td>
<td>Library</td>
<td>Sports</td>
</tr>
<tr>
<td>Wednesday</td>
<td>Maths</td>
<td>Computer</td>
<td>Physics</td>
<td colspan="3">Seminar / Workshop</td>
</tr>
<tr>
<td>Thursday</td>
<td>Computer</td>
<td>English</td>
<td>Maths</td>
<td>Lab</td>
<td colspan="2">Lab Continued</td>
</tr>
<tr>
<td>Friday</td>
<td>Physics</td>
<td>Maths</td>
<td>Computer</td>
<td>Library</td>
<td>English</td>
<td>Discussion</td>
</tr>
</tbody>
<!-- Table footer using tfoot -->
<tfoot>
<tr>
<td colspan="8">Note: Lab sessions are
held in the CS Lab Block 2. Seminars are compulsory.</
td>
</tr>
</tfoot>
</table>
</body>
</html>