lab program answers
lab program answers
label,“Meals”, and three secondary labels, “Breakfast”, “Lunch”, and “Dinner”. There
must be two levels of row labels: an overall label, “Foods”, and four secondary labels,
“Bread”, “Main Course”,“Vegetable” and “Dessert”. The cells of the table must contain a
number of grams for each of the food categories.
<html>
<head>
<title>Two-Level Table</title>
</head>
<body>
<h1>Foods and Meals Table</h1>
<table border=1>
<thead>
<tr>
<th rowspan="2">Foods</th>
<th colspan="3">Meals</th>
</tr>
<tr>
<th>Breakfast</th>
<th>Lunch</th>
<th>Dinner</th>
</tr>
</thead>
<tbody>
<tr>
<th>Bread</th>
<td>50g</td>
<td>60g</td>
<td>40g</td>
</tr>
<tr>
<th>Main Course</th>
<td>100g</td>
<td>150g</td>
<td>120g</td>
</tr>
<tr>
<th>Vegetable</th>
<td>70g</td>
<td>80g</td>
<td>90g</td>
</tr>
<tr>
<th>Dessert</th>
<td>30g</td>
<td>50g</td>
<td>40g</td>
</tr>
</tbody>
</table>
</body>
</html>
<html>
<head>
<title>Light Bulbs Order Form</title>
</head>
<body>
<h1>Order Form</h1>
<form>
<label>Name:</label><br>
<input type="text" id="name" name="name"><br>
<label>Choose your light bulbs:</label><br>
<input type="checkbox" id="option1" name="bulbs" value="2.39">
<label>Four 100-watt light bulbs for $2.39</label><br>
Write a JavaScript that calculates the squares and cubes of the numbers from 0 to 10 and
outputs HTML text that displays the resulting values in an HTML table format.
<html>
<head>
<title>Square and Qube of Number</title>
</head>
<body>
<table border="1">
<tr>
<th>Number</th>
<th>Square</th>
<th>Cube</th>
</tr>
<script language="javascript">
for(a=0;a<=10;a++)
{
document.write("<tr><td>"+a+"</td><td>"+(a*a)
+"</td><td>"+(a*a*a)+"</td></tr>");
}
</script>
</body>
</html>