You are on page 1of 23

1. Design a html table for student information.

2. Write a program to move a text in Web page using Html.


3. Design a registration form using html input controls.
4. Design a Xhtml table for student information.
5. write a css file.
6. Design an xml file.
7. show the message hello world using JavaScript and html.
8. Enter the value of quantity and price and calculate total using
JavaScript.
9. Gives the links for navigation from one page to another page
and apply images and css on web page using html.
10. Program for adding two numbers in JSP.

1. Design a html table for student information.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<html>
<head>
<title>html table</title>
</head>
<body>
<!-- table tag is used for table -->
<table style="width: 100%" border="2" ID="Table1">
<!-- tr tag is used for row-->
<tr>
<!-- td tag is used for column-->
<td align="center" style="width: 100%" colspan="5">
<h1> <!-- h1 tag is used for headings-->
Student Information</h1>
</td>
</tr>
<tr>
<td style="width: 20%">
<b>Name</b></td>
<td style="width:20%">
<b>Address</b></td>
<td style="width: 20%">
<b>City</b></td>
<td style="width: 20%">
<b>State</b></td>
<td style="width: 20%">
<b>Phone No.</b></td>
</tr>
<tr>
<td style="width: 20%">
Raju
</td>
<td style="width: 20%">
101 lig</td>
<td style="width: 20%">
Indore</td>
<td style="width: 20%">
M . P.</td>
<td style="width: 20%">
9977152360</td>
</tr>
<tr>
<td style="width: 20%">
Ram</td>
<td style="width: 20%">
102 mig</td>
<td style="width: 20%">
Bhopal</td>
<td style="width: 20%">
M.P</td>
<td style="width: 20%">
9977152360</td>
</tr>
</table>
</body>
</html>

OutPut:

Student Information
Name Address City State Phone No.
Raju 101 lig Indore M . P. 9977152360
Ram 102 mig Bhopal M.P 9977152360

2. Write a program to move a text in Web page using Html.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Marquee </title>

</head >
<body>
<form>
<table width="100%">
<tr>
<td>
<!-- font tag is used to set the font size color -->
<FONT SIZE="4" FACE="courier"
COLOR="blue">

<MARQUEE WIDTH="100%"
BEHAVIOR="ALTERNATE" BGColor="yellow">This is an example of an alternating
marquee...</MARQUEE></FONT>
</td>
</tr>
<tr>
<td>
<FONT SIZE="4" FACE="courier"
COLOR="blue">
<MARQUEE WIDTH="100%"
BEHAVIOR="SCROLL" BGColor="yellow" LOOP="3">This is an example of a
scrolling marquee...</MARQUEE></FONT>
</td>
</tr>
<tr>
<td>
<FONT SIZE="4" FACE="courier"
COLOR="blue">
<!--
Direction attribute is used for move the text -->

<MARQUEE WIDTH="100%"
BEHAVIOR="SCROLL" DIRECTION="RIGHT" BGColor="yellow">This is an
example of a marquee scrolling to the right...</MARQUEE></FONT>
</td>
</tr>
<tr>
<td>
<!-- nested
marquee -->

<marquee direction="down"
behavior="alternate" height="150">
<marquee behavior="alternate">
<font size="7">?
</font></marquee>
</marquee>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</form>
</body>
</html>
OutPut :
3. Design a registration form using html input controls.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<html>
<head>
<title>html table</title></head>
<body>
<!-- table tag is used for table -->
<table id="Table1" style="WIDTH: 100%">
<!-- tr tag is used for row-->
<tr>
<!-- td tag is used for column-->
<td align="middle" colSpan="5">
<h1> <!-- h1 tag is used for headings-->
Registration form</h1>
</td>
</tr>
<tr>
<td>Name:</td>
<td><input id="txtName" type="text"></td>
<td>Age:</td>
<td><input id="txtAge" type="text"></td>
</tr>
<tr>
<td>Contact No.</td>
<td>&nbsp;<INPUT id="Text1" type="text"
name="Text1"></td>
<td>Sex:</td>
<td><input id="rdomale" type="radio" value="Male"
name="Text1"> <input id="Radio1" type="radio" value="Female" name="Text1"></td>
</tr>
<tr>
<td>Address:</td>
<td colSpan="3"><textarea rows="5"
cols="40"></textarea>
</td>
</tr>
<tr>
<td>Pay By</td>
<td><input id="Checkbox1" type="checkbox"
value="check" NAME="Checkbox1"> <INPUT id="Checkbox2" type="checkbox"
value="cash" name="Checkbox1">
<INPUT id="Checkbox3" type="checkbox"
value="DD" name="Checkbox1"></td>
<td>Sex:</td>
<td><input id="Radio2" type="radio" value="Male"
name="Text1"> <input id="Radio3" type="radio" value="Female" name="Text1"></td>
</tr>
<tr>
<td>language</td>
<td><SELECT id="Select1" size="4" name="Select1"
multiple>
<OPTION>
C
</OPTION>
<OPTION>
.net
</OPTION>
<OPTION>
JAVA
</OPTION>
<OPTION>
php
</OPTION>
<OPTION>
Oracle
</OPTION>
</SELECT></td>
<td>exp</td>
<td>&nbsp;<SELECT id="Select2" name="Select2">
<OPTION selected>
0</OPTION>
<OPTION selected>1</OPTION>
<OPTION selected>
2</OPTION>
<OPTION selected>
3</OPTION>
</SELECT></td>
</tr>
</table>
</body>
</html>
OutPut:

Registration form
Name: Age:
Contact No.   Sex:

Address:

Pay By Sex:

language exp  
4. Design a Xhtml table for student information .

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Table</title>
</head>
<body>
<!-- table tag is used for table -->
<table style="width: 100%" border="2">
<!-- tr tag is used for row-->
<tr>
<!-- td tag is used for column-->
<td align="center" style="width: 100%" colspan="5">
<h1> <!-- h1 tag is used for headings-->
Student Information</h1>
</td>
</tr>
<tr>
<td style="width: 20%">
<b>Name</b></td>
<td style="width:20%">
<b>Address</b></td>
<td style="width: 20%">
<b>City</b></td>
<td style="width: 20%">
<b>State</b></td>
<td style="width: 20%">
<b>Phone No.</b></td>
</tr>
<tr>
<td style="width: 20%">
Raju
</td>
<td style="width: 20%">
101 lig</td>
<td style="width: 20%">
Indore</td>
<td style="width: 20%">
M . P.</td>
<td style="width: 20%">
9977152360</td>

</tr>
<tr>
<td style="width: 20%">
Ram</td>
<td style="width: 20%">
102 mig</td>
<td style="width: 20%">
Bhopal</td>
<td style="width: 20%">
M.P</td>
<td style="width: 20%">
9977152360</td>

</tr>

</table>
</body>
</html>

OutPut :

Student Information
Name Address City State Phone No.
Raju 101 lig Indore M . P. 9977152360
Ram 102 mig Bhopal M.P 9977152360
5. write a css file .

H1 {
color: white; background: teal; FONT-FAMILY: arial, helvetica, lucida-sans, sans-serif;
FONT-SIZE: 18pt; FONT-STYLE: normal; FONT-VARIANT: normal
}
H2 {
COLOR: #000000; FONT-FAMILY: verdana, helvetica, lucida-sans, sans-serif; FONT-
SIZE: 14pt; FONT-STYLE: normal; FONT-VARIANT: normal
}
H3 {
COLOR: #000000; FONT-FAMILY: lucida-sans, sans-serif; FONT-SIZE: 14pt; FONT-
STYLE: normal; FONT-VARIANT: normal
}
H4 {
COLOR: #000000; FONT-FAMILY: lucida-sans, sans-serif; FONT-SIZE: 12pt; FONT-
STYLE: normal; FONT-VARIANT: normal
}
H5 {
color: white; background: darkblue; FONT-FAMILY: lucida-sans, sans-serif; FONT-
SIZE: 12pt; FONT-STYLE: normal; FONT-VARIANT: normal
}
H6 {
color: yellow; background: green; FONT-FAMILY: lucida-sans, sans-serif; FONT-SIZE:
10pt; FONT-STYLE: normal; FONT-VARIANT: normal
}

body {
COLOR: #000000; FONT-FAMILY: lucida-sans, sans-serif; FONT-SIZE: 10pt; FONT-
STYLE: normal; FONT-VARIANT: normal; background-image: url('bkgnd.gif')
}
.localheader {
COLOR: #dddddd; FONT-FAMILY: geneva, arial, helvetica, lucida-sans, sans-serif;
FONT-SIZE: 15px; TEXT-DECORATION: none
}
.locallink {
COLOR: #dddddd; FONT-FAMILY: geneva, arial, helvetica, lucida-sans, sans-serif;
FONT-SIZE: 13px; FONT-WEIGHT: normal; TEXT-DECORATION: none
}
.localsublink {
COLOR: #dddddd; FONT-FAMILY: geneva, arial, helvetica, lucida-sans, sans-serif;
FONT-SIZE: 11px; FONT-WEIGHT: normal; TEXT-DECORATION: none
}
.tm {
COLOR: #000000; FONT-FAMILY: geneva, arial, helvetica, lucida-sans, sans-serif;
FONT-SIZE: 8pt; FONT-STYLE: normal; FONT-VARIANT: normal
}
A:link .nonu {
COLOR: #000000; TEXT-DECORATION: none
}
.nonuw {
COLOR: #ffffff; TEXT-DECORATION: none
}
A:visited .nonu {
TEXT-DECORATION: none
}
.linespace {
LINE-HEIGHT: 120%
}
.just {
TEXT-ALIGN: justify
}
CODE {
COLOR: #666666; FONT-FAMILY: courier, monaco, courier new; FONT-SIZE: 12pt
}
KBD {
COLOR: #666666; FONT-FAMILY: courier, monaco, courier new; FONT-SIZE: 12pt
}
6. Design an xml file.

<!-- desgin a xml file -->


<?xml version="1.0" encoding="utf-8" ?> <!--this is doctype defination contains
information of version and encoding type-->
<student> <!--root element-->

<name> Ram</name> <!--child element-->


<address>154 lig colony indore</address>
<phone_No>9977159024</phone_No>
<City>indore</City>
<state>mp</state>

<name> jhon</name>
<address>154 palasiya indore</address>
<phone_No>9977159054</phone_No>
<City>indore</City>
<state>mp</state>

<name> Ram</name>
<address>154 mg road indore</address>
<phone_No>9977159024</phone_No>
<City>bhopal</City>
<state>mp</state>

<name> Ram</name>
<address>154 lig colony indore</address>
<phone_No>9977159024</phone_No>
<City>indore</City>
<state>mp</state>
</student>
7. Show the message hello world using JavaScript and html.

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<html>
<head>
<title></title>
<script language="javascript">
<!-- function for calculate the total -->

function Message()
{
<!-- store the values of textbox in variables -->

alert("Hello World !");


}
<!-- function for check the validation -->

function Confirmation()
{
confirm("You want to post back press ok otherwise press cancel");

}
function Promptmessage()
{
var name = prompt("Enter the value","");
alert(name);
}

</script>
</head>
<body>
<form>
<table width="100%">

<tr>
<td>
</td>
<td>
<INPUT type="submit" value="Message"
ID="Submit1" NAME="Submit1" onclick=" Message()">
<INPUT id="Button2" type="button"
value="Confirmation" name="Button1" onclick=" Confirmation()">
<INPUT id="Button1" type="button"
value="Prompt" name="Button1" onclick=" Promptmessage()">
</td>
</tr>
</table>
</form>
</body>
</html>

OutPut:
8. Enter the value of quantity and price and calculate total
using JavaScript.

<!-- write a program for calculation of input values and check validation -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="javascript">
<!-- function for calculate the total -->

function calulate()
{
<!-- store the values of textbox in variables -->
var price =document.getElementById("txtprice").value;
var Qty =document.getElementById("txtQty").value;
var Total =document.getElementById("txtTotal").value;
Total = price*Qty;
document.getElementById("txtTotal").value=Total;
alert("");
}
<!-- function for check the validation -->

function validate()
{
var message ="";
var check= true;
if (document.getElementById("txtQty").value=="")
{
document.getElementById("txtQty").value="0";
message="please enter value of qty ";
check =false;

}
else
{

if (document.getElementById("txtprice").value=="")
{
document.getElementById("txtprice").value=="0";
message=message+"please enter value of price";
check =false;

}
else
{

if (message=="")
{
alert("values is correct ");

}
else
{
alert(message);
}
if(check==true)
{
<!--call the function for calulate -->

calulate();
}
return check;
}
</script>
<title></title>
</head>
<body>
<form>
<table width="100%">
<tr>
<td colspan="2">
<marquee>Enter Quantity and Price and
Calculate Total</marquee>
</td>
</tr>
<tr>
<td>
Price:
</td>
<td>
<input type="text" id="txtprice"> <!--id is
give to textbox to access the value of controls -->
</td>
</tr>
<tr>
<td>
Qty:
</td>
<td>
<input type="text" id="txtQty">
</td>
</tr>
<tr>
<td>
Total:
</td>
<td>
<input type="text" id="txtTotal">
</td>
</tr>
<tr>
<td>
</td>
<td>
<INPUT type="submit" value="Calculate"
ID="Submit1" NAME="Submit1" onclick="return validate()">
<INPUT id="Button2" type="button"
value="calcuale without validation" name="Button1" onclick="return validate()">
<!--onclick event of buuton call the validate
function of javascript -->
</td>
</tr>
</table>
</form>
</body>
</html>
OutPut:
9. Gives the links for navigation from one page to another page
and apply images and css on web page using html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" href="test.css" />
</HEAD>
<BODY>
<table cellspacing="1" cellpadding="1" border="1" ID="Table1"
width="100%">
<tr>
<td><a href="Home.html">Home</a></td>
<td><a href="About.html">About Us</a></td>
<td><a href="Contact.html">Contact Us</a></td>
<td><a href="Registration.html">Registration</a></td>
<td><a href="Cources.html">Cources</a></td>
</tr>
<tr>
<td colspan="5"><IMG alt="Image" src="/CS-IT/Blue
hills.jpg">
</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</BODY>
</HTML>
OutPut:
Home About Us Contact Us Registration Cources

Image
10. Program for adding two numbers in JSP.

<%@ page language="java"%>


<html>
<head>
<title>Add number program in JSP</title>
</head>

<body>
<%
 int a=5;
 int b=2;
 
 int result=a+b;
  
 out.print("Additon of a and b :"+result);
%>
</body>
</html>

OutPut: Addition of A and b : 7

You might also like