Advertisements
Advertisements
Question
Write the HTML code to design the web page as shown below, considering the given specifications:

- Specification 1: The webpage code should follow the correct HTML structure. “My Schedule” should be displayed using the first-level heading, and the background colour of the page should be light yellow.
- Specification 2: Use the table header tag for the column headers.
- Specification 3: The table should have exactly 4 rows and 4 columns, with the first row displaying the table header and the remaining rows for student data, as shown above.
- Specification 4: The table should use rowspan and colspan, wherever required, as shown in the given table.
Code Writing
Advertisements
Solution
<!DOCTYPE html>
<html>
<head>
<title>My Schedule Page</title>
</head>
<body style="background-color: lightyellow;">
<!-- Specification 1: First level heading -->
<h1>My Schedule</h1>
<!-- Specification 3: Table with border -->
<table border="1">
<tr>
<!-- Specification 2: Using table header tags -->
<th>Name</th>
<th>Morning</th>
<th>Noon</th>
<th>Evening</th>
</tr>
<tr>
<td>Sahil</td>
<td>Running</td>
<td>Self Study</td>
<!-- Specification 4: Rowspan for Gym -->
<td rowspan="2">Gym</td>
</tr>
<tr>
<td>Abhay</td>
<td>Yoga</td>
<td>Tuition</td>
</tr>
<tr>
<td>Neha</td>
<!-- Specification 4: Colspan for School -->
<td colspan="2">School</td>
<td>Dancing</td>
</tr>
</table>
</body>
</html>shaalaa.com
Is there an error in this question or solution?
