17mtcs068-Lab Manual
17mtcs068-Lab Manual
EXERCISE 1:
Write a HTML coding to create table with rows & columns. Split them using
Rowspan and Colspan tags.
Procedure:
Coding:
<html>
<head><title> COLSPAN FOR MULTI-COLUMN HEADING</title></head>
<body>
<table>
<caption>Life Expectancy By Current Age</caption>
tr>
<th colspan="2">65</th>
<th colspan="2">40</th>
<th colspan="2">20</th>
</tr>
<tr>
<th>Men</th>
<th>Women</th>
<th>Men</th>
<th>Women</th>
<th>Men</th>
<th>Women</th>
</tr>
<tr>
<td>82</td>
<td>85</td>
<td>78</td>
<td>82</td>
<td>77</td>
<td>81</td>
</tr>
</table>
</body>
</html>
WEB TECHNOLOGIES LAB 17MTCS068
<html>
<head><title> rowspan</title>
</head>
<body>
<table> <caption>Favorite and Least Favorite Things</caption>
<tr> <th></th><th></th>
<th>Bob</th>
<th>Alice</th>
</tr>
<tr>
<th rowspan="2">Favorite</th>
<th>Color</th>
<td>Blue</td>
<td>Purple</td>
</tr>
<tr>
<th>Flavor</th>
<td>Banana</td>
<td>Chocolate</td>
</tr>
<tr>
<th>Least Favorite</th>
<th>Color</th>
<td>Yellow</td>
<td>Pink</td>
</tr>
<tr>
<th>Flavor</th>
<td>Mint</td>
<td>Walnut</td>
</tr>
</table>
</body>
</html>
WEB TECHNOLOGIES LAB 17MTCS068
WEB TECHNOLOGIES LAB 17MTCS068
EXERCISE 2:
Write an HTML page with Javascript that takes a number from one text field
in the range 0-999 and display it in other text field in words.If the number is
out of range ,it shold show “out of range” and if it is not a number ,it should
show “not a number” message in the result box.
Conver.html
<script language="javascript">
function convert_number_to_words(number)
{
hyphen = '-';
conjunction = ' and ';
separator = ', ';
dictionary = {
0 : 'zero',
1 : 'one',
2 : 'two',
3 : 'three',
4 : 'four',
5 : 'five',
6 : 'six',
7 : 'seven',
8 : 'eight',
9 : 'nine',
10 : 'ten',
11 : 'eleven',
12 : 'twelve',
13 : 'thirteen',
14 : 'fourteen',
15 : 'fifteen',
16 : 'sixteen',
17 : 'seventeen',
18 : 'eighteen',
19 : 'nineteen',
20 : 'twenty',
30 : 'thirty',
40 : 'fourty',
50 : 'fifty',
60 : 'sixty',
70 : 'seventy',
80 : 'eighty',
90 : 'ninety',
100 : 'hundred',
WEB TECHNOLOGIES LAB 17MTCS068
};
if (number < 0 || number > 999)
{
alert("Enter a number range between 0 and 999");
return "";
}
switch (true)
{
case (number < 21):
string = dictionary[number];
Break;
case (number < 100):
tens = parseInt(number / 10) * 10;
units = number % 10;
string = dictionary[tens];
if (units) {
string += hyphen + dictionary[units];
}
Break;
case (number < 1000):
hundreds = parseInt(number / 100);
remainder = number % 100;
string = dictionary[hundreds] + ' ' + dictionary[100];
if (remainder) {
string += conjunction + convert_number_to_words(remainder);
}
Break;
Default:
Break;
}
return string;
}
a=prompt("Enter a number");
num=parseInt(a);
document.write(convert_number_to_words(num));
</script>
WEB TECHNOLOGIES LAB 17MTCS068
Output:
WEB TECHNOLOGIES LAB 17MTCS068
EXERCISE 3:
Create a web page in the format of Front page of a News paper using Text
Output:
WEB TECHNOLOGIES LAB 17MTCS068
WEB TECHNOLOGIES LAB 17MTCS068
EXERCISE 4:
Write an ASP program to prepare Employee Pay Bill using HTML and Java
Script.
Program:
<html>
<style>
body,p {
font-family:arial;
font-size:16px;
font-weight:bolder;
}
.container {
width: 500px;
clear: both;
}
.container input {
width: 100%;
clear: both;
}
</style>
<div class="container">
<body>
<h3> Payroll System </h3>
<br/>Employee's Name
<input type="text" id="emp_name" name="emp_name">
<br>
<br/> Designation
<input list="des" id = "design"/>
<datalist id="des">
<option value="MD">
<option value="HR">
<option value="TL">
<option value="TM">
</datalist>
<br/>
<br>
<br/> Number of Days Work
WEB TECHNOLOGIES LAB 17MTCS068
<input type="number" id="no_days_work" name="no_days_work">
<br>
<br>
<button onclick="solve_salary()">Solve Salary</button>
<br><br>
<p id="demo"></p>
<p id="demo2"></p>
</div>
<script>
function solve_salary() {
var emp_name = document.getElementById("emp_name").value;
var desig= document.getElementById("design").value;
var no_days_work = document.getElementById("no_days_work").value;
var gross_pay;
if(desig == "MD")
gross_pay = 2350 * no_days_work;
else if(desig == "HR")
gross_pay = 1400 * no_days_work;
else if(desig == "TL")
gross_pay = 700 * no_days_work;
else
gross_pay = 300 * no_days_work;
Output:
WEB TECHNOLOGIES LAB 17MTCS068
EXERCISE 5:
<!--DOCTYPE html-->
<html>
<head>
<style>
body{
margin-top:60px;
margin-bottom:60px;
margin-left:200px;
margin-right:200px;
background-color: grey ;
color: beige;
font-weight: bold;
font-family: Lucida;
text-align: center;
}
</style>
<script >
function Calc(){
var total,average;
if(average>60)
{
document.getElementById('res').value = "Pass";
}
else
{
document.getElementById('res').value = "Fail";
}
}
else
alert("cancelled");
</script>
</head>
<body>
<form>
Welcome to the Result evaluation system</h1><br/><br/>