HTML Programs Unit 2
HTML Programs Unit 2
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<table border="1">
<tr>
<th colspan="3">Subjects</th>
</tr>
<tr>
<th>Math</th>
<th>Science</th>
<th>English</th>
</tr>
<tr>
<td>John</td>
<td>85</td>
<td>90</td>
<td>88</td>
</tr>
<tr>
<td>Mary</td>
<td>78</td>
<td>82</td>
<td>91</td>
</tr>
<tr>
<td>David</td>
<td colspan="3">Absent</td>
</tr>
</table>
</body>
</html>
2) Write a HTML program, to explain the working of tables by preparing a timetable. (Note: Use
<caption> tag to set the caption to the table & also use cell spacing, cell padding, border,
rowspan colspan etc.).
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Weekly Timetable</title>
</head>
<body>
<tr>
<th rowspan="2">Day</th>
<th colspan="5">Subjects</th>
</tr>
<tr>
<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>2:00 - 3:00</th>
</tr>
<tr>
<td>Monday</td>
<td>Math</td>
<td>Physics</td>
<td>Chemistry</td>
<td>English</td>
</tr>
<tr>
<td>Tuesday</td>
<td>Biology</td>
<td>Math</td>
<td>Physics</td>
<td>Computer Science</td>
</tr>
<tr>
<td>Wednesday</td>
<td>Chemistry</td>
<td>English</td>
<td>Math</td>
<td>Physics</td>
</tr>
<tr>
<td>Thursday</td>
<td>Physics</td>
<td>Chemistry</td>
<td>Biology</td>
<td>Math</td>
</tr>
<tr>
<td>Friday</td>
<td>English</td>
<td>Computer Science</td>
<td>Physics</td>
<td>Chemistry</td>
</tr>
</table>
</body>
</html>
3) Write a HTML program, to explain the working of forms by designing Paristration form. /Note:
Include text feld, password field, number field, date of birth field, checkboxes, radio buttons, list
boxes using sselectrocoptions tapy, etext arens and two buttons le subrit and reset. Use tables
to provide a better view).
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
</head>
<body>
<tr>
</tr>
<tr>
<td><label for="email">Email:</label></td>
</tr>
<tr>
<td><label for="password">Password:</label></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td>Gender:</td>
<td>
<label for="male">Male</label>
<label for="female">Female</label>
<label for="other">Other</label>
</td>
</tr>
<tr>
<td>Hobbies:</td>
<td>
<label for="reading">Reading</label>
<label for="sports">Sports</label>
<label for="music">Music</label>
</td>
</tr>
<tr>
<td>
<option value="btech">B.Tech</option>
<option value="mtech">M.Tech</option>
<option value="mba">MBA</option>
<option value="bba">BBA</option>
</select>
</td>
</tr>
<tr>
<td><label for="address">Address:</label></td>
</tr>
<tr>
</td>
</tr>
</table>
</form>
</body>
</html>
4) Write a html. program, to explain the working of frames, such that page is to be divided into 3
parts on either direction. (Note: first frame second frame paragraph. third frame 0 hyperlink. And
also make sure you using "no frame" attribute such that frames to be fixed).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Frameset Example</title>
</head>
<noframes>
<body>
<p>Your browser does not support frames. Please upgrade your browser.</p>
</body>
</noframes>
</frameset>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>First Frame</title>
</head>
<body>
<p>This is a paragraph inside the first frame, explaining the working of frames.</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Second Frame</title>
</head>
<body>
<h2>Second Frame</h2>
<p>This frame also contains some content explaining how frames work.</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Third Frame</title>
</head>
<body>
<h2>Third Frame</h2>
</body>
</html>