HTML Part – 5|Computer Science TPS

Scope of the Syllabus
Probable marks : 14

Above probable marks means : In board exam questions asked form this chapter are nearly for 14 marks out of 50 Marks.

Scope of the Syllabus

1. Introduction to HTML.

2. Why HTML ? Its advantages and drawbacks.

3. Study of tags : <HTML>, <HEAD>, <TITLE>,<BODY>, <P>, <BR>, <UL>, <OL>, <PRE>, <MARQUEE>

4. Font styles : <B>, <I>, <U>, <BIG>, <SMALL>, <SUB>, <SUP>, <FONT>


7. Tables: <TABLE>, <CAPTIONS>, <TR>, <TH>, <TD>

8. Use of scripting as a language support.
Note : Only VBscript using for….next, If … then, MsgBox, InBox, DIM, SET.

HTML Part - 3|TPS Computer Science 12th Class

Q. 20 What is <TABLE> tag ? What are the attributes that can be used with <TABLE> tag ?

Ans :
1) A table can be created using <TABLE> …… </TABLE>
2) A table consists of rows and columns (also called as cells.)
3) The row is to be defined first and then cells or columns are inserted into the row from left to right.
4) The row is created using <TR> …. </TR> tag while the cells can be inserted in the row using <TH> …. </TH> or <TD> …. </TD> tags.
5) Normally <TH> tag is used just to give the heading or title to the column or row or both.
6) <TD> is used for displaying actual data. Structure of a simple table is given below :

Name of the AttributeDescription
1. BorderDraw an outline around table row and cell. By default table has no border.<Table border = “2” >
2. WidthDefines how wide your table will appear across the width of the screen<Table width = “50” > absolute value in pixels <Table width = “80%”>
percentage value of document width.
3. CellpaddingDecides the amount of spacing between each cell border and the actual content of cell.<table cellpadding = “2” border = “2”>
4. CellspacingCreates space between the cells.<table border = “4” cellspacing = “4″>
5. BgcolorTo give the background color to the table<table border = “4″ bgcolor = “red’”>
6. BordercolorGive the color to the border<table border = “4” bgcolor = “red” bordercolor = “black”>
7. AlignDecides the alignment of the table. Default is left. <table align = “center”>

Attributes of tags as follows :

1. AlignSpecifies the horizontal alignment of row or column.
Default alignment is left.
<tr align = “center”>
<td align = “right’>>
2. ValignSpecifies the vertical alignment of row or column.
Default alignment is left.
<tr valign = “center”>>
<td valign = “right’>>
3. BgcolorSpecifies background color of specific row or column.<tr bgcolor = “aqua”>>
<td bgcolor = “brown’>

Attributes of table cell only as follows :

1. colspanNumber of columns that a cell spans.<td colspan = “2”>
2. rowspanNumber of rows that a cell spans.<td rowspan = “2”>

Q. 21 Explain the use of following tags in HTML.
1. <CAPTION> tag
2. <TR> tag
3. <TH> tag
4. <TD> tag

Ans :

1) <CAPTION> tag :

1) <CAPTION> tag is used to create a caption on top of or below the table.

2) It requires <CAPTION> start </CAPTION> tag and end tag.

3) It can be used with ALIGN attribute by setting it to TOP or BOTTOM.

4) Caption is displayed outside the table’s border.

e.g. <TABLE>
        <CAPTION ALIGN = "TOP">
            Yesterday's Weather

2) <TR> tag:

(March 2005)

1) <TR> is table row tag. The start tag is and end tag is <TR> and tag is </TR>

2) It creates a horizontal row of cells and contains table headings or table data.

3) Each use of a table row element (tag) begins a new table row.

4) A row must contain atleast one table data element or table heading element.

5) It includes attributes like ALIGN, BGCOLOR and VALIGN.

3) <TH> tag:

(Mar 2013)

1) <TH> is table heading tag. The start tag is <TH> and the end tag is <TH>.

2) This tag is used to represent individual column heading of a table.

3) By defult text in this cell is bold and centered.

4) It has ALIGN, VALIGN, CELLSPACING, CELLPADDING etc. attribute to set the heading content (LEFT, RIGHT, CENTER)

4) <TD> tag :

1) <TD> is table data tag. The start tag is and the end tag is <TD> and the end tag is </TD> .

2) <TD> creates each individual cell.

3) The number of cells in a row determines the number of columns.

4) It includes ALIGN, VALIGN, CELLSPACING, CELLPADDING etc. attribute.

5) By default text in this cell is aligned left and centered vertically.

Q. 22 What are COLSPAN and ROWSPAN attributes ?

Ans :

1) COLSPAN and ROWSPAN are special attributes that can be used with<TH> and <TD> tags.

2) There may be some situation, in which one cell of table to span more than one row or column. For such situations, COLSPAN and ROWSPAN attributes may be used.

3) The COLSPAN attribute can be used to make cell contents merge with another cell.


<TD COLSPAN = “2’>
<TH COLSPAN = “2”>

This spans two columns.
4) The ROWSPAN specifies how many rows a cell should take up.


 <TD ROWSPAN = “2">
<TH ROWSPAN = “2”> 

Q. 23) List any three types of hyperlinks with suitable example.

(March 2003)

Ans :

1) In HTML, link is created to jump from one document to other, or image or any local or Web pages by using special tag ie. <A> anchor tag. </A>

Syntax : <A HREF="URL"> name or image which can be treated as link . </A>

There are following types of hyperlinks

a) Link to page on the World Wide Web :
e.g. <A HREF=”” Enter your name </A>
The string ‘Enter your name’ is a hypertext link to the website indicated by URL Specific

b) Link to a image by image as a link.:
e.g. <A HREF = “img.jpg”> <IMG SRC=”img2.jpg”></A>
The image img.gif is a hypertext link to the image file img2.jpg.

c) Link to document located in different directory :
e.g. <A HREF=”d:\ power \ab.html” Click Here </A>

Here by clicking on Click Here link, destination page i.e. ab.html will be displayed which ; specified in the path given.

Q. 24 What is script ? Explain VB script. Give one example.

Ans :

1) A script means a series of commands that will be executed by host environment (or server).

2) Scripting enables us to set and store variables, performs operations on variables.

3) By integrating script, make static HTML page active or dynamic, so that it is called as DHTML ie. dynamic hyper text markup language.

4) Scripting languages are special programming languages. These are used on web page to control different elements of the page including controls frames and browser interface.

5) There are two famous scripting languages :
1) VB Script
2) Java Script

6) VB Script allows web author to write small scripts, that will be executed on users browsers rather than on the servers.

e.g. An application collects data from a form and then sends it to the server. If it can validate the data for completeness and correctness before sending it to the server, it will greatly improve the performance of browsing section. Since data is sent to server only if it is verified as correct.

7) Another imortance of VB Script is increased functionality introduced to the web authors if the form of applet, plugs-in, Active (x)-control and objects. Each of these things can be used to add extra functions and interactivity to the web page.

  SUB can()
    Msgbox "HELLO WORLD"

Q. 26 Give the advantages (features) of VBScript.

Ans :
(i) VBScript designed to be fast :
VB Script does not support any strict data type (i.e. integer, character, float etc.). The only
data type available is varient. It is a special all purpose data type, which can be used to store
any kind of data.

(ii) VB Script is safe :
It provides file system components which consists of objects, which can be used to perform I/O. But, all language features that enable access to local files on which application is running has been removed from VB script to enhance the security.

(iii) Rich set of functions :
VB Script provides with rich set of functions for performing various types of operations via
array, manipulating functions, data and time functions, string functions, mathematical functions, conversion functions.

(iv) Error handling :
VB Script allows user to access s and handle errors through the use of Err object.

Q. 27 What are the limitations of VB Script ?

Ans :
i) Array handling : All VB Script arrays are zero based. It does not allow user to change the base of an array variable for specific implementation.

e.g. If we want to create array of top ten students in a class, it would make Sense to to state array from 1. But we must start array from zero.

ii) VB Script cannot create user defined data type : VB Script p reviges ee Sesser Object and collections, but does not give provision for a user to teat user defined data type.

(iii) Dynamic data exchange (D.D.E.) : Is not supported in VB Script, as it may violet the intergit of server.

Sharing Is Caring:

Leave a Comment