0% found this document useful (0 votes)
399 views38 pages

HTML Advancedtables, Lists & Links - Chapter 6 TOPIC - 1 Lists and Links Objective Type Questions

The document discusses HTML lists and links. It provides 10 multiple choice questions about using the <a>, <ul>, and <ol> tags to create links and lists in HTML. It also includes true/false, fill-in-the-blank, and short answer questions about topics like the different types of lists, creating hyperlinks, and nesting lists. The questions cover technical details like attributes used in lists as well as conceptual topics such as the differences between ordered and unordered lists.

Uploaded by

Vikas Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
399 views38 pages

HTML Advancedtables, Lists & Links - Chapter 6 TOPIC - 1 Lists and Links Objective Type Questions

The document discusses HTML lists and links. It provides 10 multiple choice questions about using the <a>, <ul>, and <ol> tags to create links and lists in HTML. It also includes true/false, fill-in-the-blank, and short answer questions about topics like the different types of lists, creating hyperlinks, and nesting lists. The questions cover technical details like attributes used in lists as well as conceptual topics such as the differences between ordered and unordered lists.

Uploaded by

Vikas Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

HTML ADVANCEDTABLES, LISTS & LINKS - Chapter 6

TOPIC – 1 Lists and links


Objective Type Questions
[A] choose the correct alternative.

1. which of the following tag is used to link the URL?

(a) <hyperlink>

(b) <link>

(c) <a>

(d) <style>

Ans. <a>

2. link URL in HTML is specified using ………… attribute.

(a) src

(b) href

(c) rel

(d) link

Ans. (b) href

3. following tag stands for-<a>

(a) action tag

(b) additional tag

(c) anchor tag

(d) active tag

Ans. (c) anchor tag

4. value of attribute “href” is also called as ……… of the destination webpage.

(a) URS

(b) URK
(c) URL

(d) URM

Ans. (c) URL

5. URL in HTML stands for ………..

(a) universal resource locator

(b) uniform resource locator

(c) Uni resource locator

(d) none of these

Ans. (b) uniform resource locator

6. link in HTML can be of following type (s).

(a) unvisited

(b) visited

(c) active

(d) all are these

Ans. all are these

7. default style and color of unvisited link in any browser is ………

(a) underline and Magento

(b) normal and blue

(c) underline and pink

(d) underlined and blue

Ans. (d) underlined and blue

8. which of the attribute (s) cannot be present if the href attribute is not present?

(a) hreflang

(b) rel

(c) target
(d) all of these

Ans. (D) All of these

9. in <OL> and <UL>, the style of bullet or number is defined by

(a) type attribute

(b) style attribute

(c) target

(d) none of the these

Ans. (a) type attribute

10. which of the following will produce a solid circle bullet when given as a type for <UL>?

(a) circle

(b) square

(c) disc

(d) none of these

Ans. (c) disc

[B] state whether these statements are true or false.

1. anchor element is used to create a hyperlink.

Ans. true

2. <HL> creates a direct list.

Ans. false

3. both audio and video can be inserted on a webpage using lists.

Ans. false

4. the href attribute is mandatory with <a> tag.

Ans. True
5. an email can be created by using sendto: Attribute.

Ans. false

6. anchor tag is a container tag.

Ans. true

[C] fill in the blanks.

1. …….. tag creates a bulleted list.

Ans. UL

2. VLINK means ……….

Ans. visited link

3. A/An ……. Link allows a link to another section on the same web page.

Ans. URL

4. the default color of a hyperlink on a web page is ……

Ans. blue

5. in case of ordered lists, the <LI> tag inserts a ………. And for unordered list, it inserts a ………..

Ans. number, bullet

6. the ………. Tag is designed to fit on a single line of web page.

Ans. <DT>

7. the …………. Tag accepts a full paragraph of text.

Ans. <DD>

Very Short Answer Type Questions


Q.1. what are the different types of lists available in HTML?

Ans. there are 3 types of lists – ordered lists, unordered lists and definition lists

Q.2. what is the use of type attribute of <ul> tag?

Ans. type attribute is used to change the shape of the bullets in the unordered list. There are three
types. DISC, SQUARE, CIRCLE

Q.3. what is the use of START attribute used in lists?

Ans. the START attribute is used to change the beginning value of an ordered list. Normally, the ordered
list starts with 1. For example, <OL START = “5”> </OL>

Q.4. identify the error in the following HTML code. Rewrite the correct code.

<UL TYPE = “a” START = 4>

Ans. <OL TYPE = “A” START = “4”>

Q.5. how is <OL> tag different form <UL> tag of HTML?

Ans. <OL> stands for ordered list. This tag is used to display an ordered/a numbered list.

<UL> stands for unordered list. This tag is used to display a bulleted list.

Q.6. write the name of HTML tag used to include numbered list in HTML web page.

Ans. <OL> tag

Q.7. explain the following statement:

<BODY bgcolor=”yellow” text = “red” vlink= “bule”> TRIAL </BODY>

Ans. the code will set the web page background as yellow, text color as red and visited link color as blue.

Q.8. your school’s web address is https://www.cbsepractice.in/ want to create a link to this web site
from your web page. Write the HTML code you will use to do this.

Ans. <a href”http://www.cbsepractice.in/”>my school</a>


Q.9. difference between <a> as an anchor and <a> as a link.

Ans. <a> as an anchor allows us to go from one part of the same page to another while <A> as a link
allows us to go from one page to another page.

Q.10. which attribute of the <A> tag is used to add a text pop-up to an element in your web page?

Ans. title attribute of the <A> tag is used to add a text pop-up to an element in web page.

Q.11. write the code to create an image named “heritage.gif” as a hyperlink to” india.html”.

Ans. <A href=”India.html”>

<img src=”heritage.gif></A>

Q.12. what do you understand by name attribute?

Ans. name attribute allows the user to create links within the same document. This attribute specifies
the name of the anchor being set up and always it should not be unique.

Short Answer Type Questions

Q.1. explain unordered list.

Ans. unordered list classifies the data items that have equal importance i.e. none of the data items are
ranked. They are identified by a symbol. It may be a square, a O circle or a disc. The attribute TYPE helps
in using the symbols of the symbol.

<ul type =”square”>

<ul type=”disc”>

<ul type=”circle”>

This is a container tag. It has both the opening and the closing tag. The listing is created under it using
the <li> tag. Again <li> tag is a container tag. The data item to be listed is input between the opening <li>
and the closing </li> tag as shown in the following example.
<body> Apples
<ul> Oranges
<li>apples >li> Guava
<li>oranges</li>
<li>guave<li>
</ul>
</body>
Q.2. write a short note on ordered list.

Ans. ordered list classifies the data items that do not have equal importance. All the data items are
ranked. The renking can be done using the numbers, the roman letter or alphabets. The default symbol
is number. In case you want to change to other symbols of ordered used with this tag are given in the
table below:

Attributes of <ol> tag Description


TYPE Changes the symbol used
with the list. It takes the
value as the symbol itself
i.e. it can be “a” or “A” “I” or
“I” or “1”
STATE Begins the list with value
specified it takes the value
of the symbol from where to
begin the list

Q.3. what are definition lists?

Ans. definition lists (<dl>)are the list elements that have an array of tags. The list prepared by <dl> tag is
similar to a dictionary. The other tags used with this are <dt> to define the definition term and the <dd>
for the definition of the list item.

<H4> definition lists </H4> Output:


<dl> Definition lists
<Dt> Kanchipuram </dt> Kanchipuram
<dd> temple city </dd> Temple city
<dt> <b> Jaipur </b></dt> Jaipur
<dd> pink city </dd> Pink city
</dl>

Q.4. how will you create email link?

Ans. we can create an email link on web page. The browser will read an email link, using the value
starting with mailto:” rather than http://, with an email address rather than a web address. The syntax is
given below:

<A> HERF=” mailto:[email protected]”>email the username </A>

Q.5. what are nested lists?

Ans. lists can be nested or placed inside one another.

Example:
<BR> ILLUSTRATION of nested lists
<H4> ILLUSTRATION of nested lists </h4> Subjects of study
<BODY> 1. math
<H4>SUBJECTS OF STUDY 2. English
</h4> 3. language
<ol> 0 Hindi
<li> Math O Sanskrit
<li> English 0 Tamil
<li> language 4. science
</ul> 5. social science
<li> science 6. computer applications
<li> social science
<li> computer
Applications
</ol>
</BODY>

Q.6. Shambhavi has to design two web pages with following specifications:

(i) one web page should have an unordered list. (ii) another web should have an unordered list. “yellow”
in color.

Suggest her suitable tag(s) and attributer(s) for the above specifications.

Ans. (i) <UL> <LI>

(ii) <body> tag and bgcolor attribute

Q.7. Jennifer wants to write html code to crate an ordered list starting with “c”. help her in writing the
code.

Ans. <ol type =”a” start=”3”>

Q.8. which three tags are used to create definition lists?

Ans. 1. <dl> (definition list)

2. <dt> (definition term)

3. <dd> (definition description)

Q.9. create an ordered list of the name of the subjects you study in school.

Ans. <ol>
<li> English </li>

<li> mathematics </li>

<li> science </li>

<li> social science </li>

</li> Tamil </li>

</ol>

Q.10. write HTML code for the following:

To provide hyperlink to a website http://www.cbse.nic.in”

Ans. <html>

<head>

<title>

Link

</title>

</head>

<body>

<a href = http://www.cbse.nic.in>www.Cbse.nic.in</a>

</body>

</html>

Q.11. how will you nest an unordered list inside an ordered list?

Ans. <html>

<head>

<title> set of list

</title>

<head>

<body>

<ol>

<li> first order point


<ul>

<li> first unordered list item </li>

<li> second unordered list item </li>

</ul>

</li>

<li> another ordered point </li>

</ol>

</body>

</html>

Q.12. write the HTML code to create the following indentation effect: apple pie, pudding, and pancake,
all begin with an A.

Ans. <html>

<head>

<title> example </title>

</head>

<body>

<dl>

<dt> apple pie,</dt>

<dd> pudding, </dd>

<dl>

<dd> and pancake, </dd>

</dl>

All begin with an A.

</dl> </body>

</html>

Q.13. use a definition list to show that the word “glunch” means “a look of disdain, anger, or
displeasure” and that the word “glumpy” means “sullen, morose, or sulky”
Ans. <html>

<head>

<title> example </title>

</head>

<body>

<DL>

<DT> glunch </DT>

<DD> a look of disdain, anger, or displeasure </DD>

<DT> glumpy </DT>

<DD> sullen, morose, or sulky </DD>

</DL>

</body>

</html>

Q.14. what are the attributes of audio tag?

Ans.

Attribute Description Value


Autoplay Plays the audio file Autoplay
automatically when
the web page is
loaded
Controls Displays the controls Controls
on the web page
Src Specifies the URL of URL
the audio file
Loop Indicates if the audio Loop
file should be
replayed once it has
finished playing

Q.15. how do we insert audio in an HTML file?

Ans. <!DOCTYPE html>

<html>

<head>
<title> INSERT SOUND FILE <title>

</head>

<body>

<h2> LISTENING TO MUSIC <H2>

<audio controls=”controls”

</audio>

</body>

</html>

Q.16. what are the attributes of video tag?

Ans.

Attribute Description Value


Src Specifies the URL of the URL
video file to be played
Height Specifies the width of Value in pixels
the video player
displayed on the web
page
Width Specifies the width of Value in pixels
the video player
displayed on the web
page
Autoplay Plays the video file Autoplay
automatically on
loading a web page
Controls Displays the controls on Controls
a web page such as the
play button

Q.17. how to insert video in a webpage?

Ans. <!DOCTYPE html>

<html>

<head>

<title> inserting video file <title> </head>

<body>
<h2> lest watch a video </h2>

< video controls =”controls” autoplay=”autoplay” src=”wildlife. Ogv”>

</body>

</html>

Q.18. Shahnawaz has to create following list through HTML as a part of his social science project. Help
him in writing HTML code for the same.

AFRICAN COUNTRIES AND THEIR CAPITALS


1. EGYPT
0 cairo
2. ETHIOPIA
0 addis ababa
3. KENYA
0 nairobi

Ans.

<HTML>
<BODY> AFRICAN COUNTRIES AND THEIR
CAPITALS<BR>
<OL> <LI> EGYPT
<UL TYPE=”circle”>
<LI> Cairo</UL>
<LI> ETHIOPIA
<UL TYPE = “circle’>
<LI> Addis Ababa</UL>
>LI> KHNYA<UL>TYPE=”circle”>
<LI> Nairobi</UL>
</OL>
</BODY>
</HTML>

Q.19. name the following with respect to HTML:

(a) Attribute for changing bullet type of list tag.

(b) element to create a hyperlink

Ans. (a) type attribute

(b) <A> tag


Q.20. write HTML code to display the unordered list (with square bullets) of two cities “DELHI” and
“MUMBAI”. The web page should have should be back ground and the title of the page should be by
cities.

Ans. <html>

<head>

<title> my cities </TITLE>

</head>

<body bgcolor = “yellow”>

<ul type = “ square”>

<li> DELHI </li>

<li> MUMBAI</LI>

</ul>

</body>

</html>

Q.21. write HTML code to display an ordered list (with uppercase roman number) listing any three
subjects being taught in your school. The web page should have a red back grounds and the title of the
page should be “my subjects.”

Ans. <html>

<head>

<title> my subjects </title>

</head>

<body bgcolor=”red”>

<ol type = “I”>

<li> science </li>

<li> math </li>

<computers</li>

</ol>

</body>

</html>
Long Answer Type Questions
Q.1. write a short note on anchor tag.

Ans. an anchor element is used to create a hyperlink in a webpage. The word anchor has came the
function performed by anchor in a ship. As an anchor supports the ship when it reaches the shore,
similarly, the document linked supports the text or the picture on the home page.

The basic syntax of anchor tag is:

<a href = “ address of the supporting web


page”
Target = “ blank or top”
Name=”text”> text acting as hyperlink
</a>
The attributes of anchor tag href, name and target.

HREF: the meaning of href is hypertext reference. This attribute is mandatory in anchor. The href
attribute takes the value as the address of the supporting document. Both the relative and absolute links
can act as values to the href attribute.

<a href =”http.//www.w3.or/”>website of W3C</a>

To link to a page on another website you need to give the full web address. Such type of link is absolute
as it specifies both the protocol name i.e. “http” and the hostname i.e. www.w3.org. the relative link can
only link to a page from the same site.

If you were linking to a page in the same folder, the href would be just page1.html” as sown below.

<a href=”page1.html”>

TARGET: the target attribute helps in opening a web page. The value, “blank” opens the webpage in a
new browser window. The value “top” opens the links webpage in the currently active browser window.

If you want to open the webpage in a new window, following code is to be used.

<a href=”http>://www.google.com”target=” blank”>search engine </a>

If you want to open the linked webpage in the same browser window is the current one, following code
is to be used:

<html>

<body> <p> open the webpage in a the current window </p>

<a href=”http:www.google.com/”target=”top”> want to google </a>

</body>

</html>

The above code will open the web page of google on clicking the link “want to google” in the browser
window as the existing window. It will not open a new window to load the webpage of google.com
NAME: this attribute gives a name to the anchor tag. This attribute takes the value as “text string” this
helps in linking to a specific section within the webpage that has been named.

If you have a long webpage with a section about “sales” this section can be given a name using name
attribute as shown below. The purpose of the name is that another anchor can link to the named
anchor.

<a name =”salessection”> sales order set up </a>

Linking to the named anchor. to link to a named anchor, add a hash mark (#) to the end of the uniform
resource locator of the webpage followed by the name of the section, it will open.

To link to a section named “salessection” within the page called named example. Html, the following is
used:

If the link is to a named anchor in the same webpage then you don’t need the file name of the webpage
just the hash mark and the name of the anchor:

To link to the sales section in our existing webpage, the following code is to be used:

Q.2. write a short note on LIST elements. Also give an example.

Ans. LIST elements have two attributes START and TUPE

START – specifies the starting number for a numbered list: START=”5” means the list will start with the
number 5.

TYPE – indicates how the items are numbered.

Unordered list of items which may appear in any particular order.

TYPE=”A” “a” “I” “I” designates the appearance of the numbers preceding the items in the list example

<h4> ILLUSTRATION OF LISTS </H4> ILLUSTRATION OF LISTS


<BODY> SUBJECTS OF STUDY
<H4> SUBJECTS OF STUDY </H4> 1. math
<ol> 2. English
<li> math 3. Hindi/Sanskrit
<li> English 4. science
<li> Hindi/Sanskrit 5. social science
<li> science 6. computer applications
<li> social science SUBJECTS OF STUDY suordered list
<li> computer applications Math
</ol> English
<h4> SUBJECTS OF STUDY unordered list Hindi /Sanskrit
</h4> Science
<ul> Social science
<li> math Computer applications
<li> English
<li> Hindi/Sanskrit
<li> science
<li> social science
<li> computer applications
</ul>
</BODY>

Q.3. carefully study the webpage given below. Identify 10 tags that have been used in creating this
webpage and write the usage of each of them.

Ans. following are the 10 tags that are used to create the preceding web page along with their one line
descrition:

(a) <HTML> : refers to a structural tag that is used to mark the starting and ending of an HTML
document.

It ends with </HTML>

(b) <BODY> : refers to a structural tag that contains all the visible content, such as text images and link
of a webpage. If ends with </BODY>

(c) <P>: refers to a formatting tag that is used to begin a new paragraph it ends with </p>

(d) <B>: refers to a formatting tag that is used to boldface text in an HTML document. It ends with </B>

(e) <CENTER> refres to a formatting tag that is used to mark text as largest heading it ends with
<CENTER>

(f) <H1> refers to a formatting tag that is used to mark text as largest heading. It ends with </H1>

(g) <IMG>: refers to a formatting tag that inserts inline images on a web page.

(h) <OL> refers to a formatting tag that inserts numbered lists. It ends with </OL>

(i) <LI> : refers to a formatting tag that marks the list items in a numbered list. It ends with <LI>

(j) <A>: refers to a formatting tag that inserts hyperlink on a web page. It ends with </A>

Q.4. write the HTML code to generate the following output.

Ans. <HTML>

<HEAD>

<TITLE> CANDY WOLD </TITLE>

</HEAD>

<BODY>

<center> <H1> <fount face =”comic sans” color = “red”> smacking lollies </font> <H/1>
</center>

<i> <u> smacking lollies</u> </i> is a new chain of stores selling variety of candies and mouth watering
lollies.

<img src =”ice.jbg”>

,br> <br>

The following is a list of major outets of smacking lollies:

<li><a href=”west.html”> west Delhi </a> - lanak puri and Rajouri garden </li>

<li> <a href=”south.html> south Delhi </a> south extension and vasant kunj</li></ul>

<center> for enquiries mail to us at [email protected]</center>

</BODY>

</HTML>

TOPIC – 2 Tables
Objective Type Questions
[A] choose the correct alternative.

1. <TR> belongs to ……….. tag.

(a) <table>

(b) <DIV>

(c) <frameset>

(d) <TD>

Ans. (a) <table>

2. ……… tag is used to add columns to a table.

(a) definition list

(b) definition list term

(c) definition list description

(d) none of the above

Ans. (d) none of the above

3. which attribute is used to define cell contents to left?


(a) VAlign

(b) align

(c) L-align

(d) haling

Ans. (b) align

. which tag is used to add a row to a table?(a) TR

(b) TD

(c) TH

(d) TC

Ans. (a) TR

5. which of the following is used to specify the beginning of a table’s row?

(a) TROW

(b) TABLER

(c) TR

(d) ROW

Ans. (c) TR

6. in order to add border to a table, BORDER tag is specified which tag

(a) THEAD

(b) TBORDER

(c) TABLE

(d) TR

Ans. (c) TABLE

7. which of these tags are called table tags?

(a) <thead><body><tr>

(b) <table><tr><td>
(c) table><head><tfoot>

(d)<table><tr><tt>

Ans. (b) <table><tr><td>

8.which HTML command is used to aling the contents of the cell to right?

(a) <TR align = “right”>

(b) <TD align = “right”>

(c) <TD> align = ‘ right

(d) all of the above

Ans. (b) <TD align = “right>

9. the two common attributes of IMG and TABLE tag are

(a) SRC and HEIGHT

(b) HEIGHT and WIDTH

(c) BORDER and SRC

(d) none

Ans. (c) BORDER and SRC

10. which of the following is not an attribute of <table> tag?

(a) border

(b) back ground

(c) bgcolor

(d) SRC

Ans. (d) SRC

11.rowspan and colspan=n can added to ……… tag

(a) <hr>

(b) <table>

(c) <td>
(d) tr>

Ans. (c) <td>

[B] state whether these statements are true or false.

1. <Th> is table header tag.

Ans. true

2. the default value of border attribute is 2.

Ans. false

3. the CELLSPACING attribute the tells the browser how much space to include between the wails of the
table.

Ans. true

4. the <CAPTION> tag has one attribute.

Ans. true

5. by default, all elements are aligned to the left.

Ans. true

6. cell padding is used with <td> tag.

Ans. false

7. settings for columns have more priority than settings for rows.

Ans. true

8. we can add borders to only the table and not cells.

Ans. false

[C] fill in the blanks.


1. the ……… attribute sets relative or absolute width of our table in the browser.

Ans. WIDTH

2. the ………. Attribute specifies the number of columns.

Ans. COLS

3. the ………… attribute tells the browser how much space to give data elements away from the walls of
eh cell.

Ans. CELLPADDING

4. ……….. is used to combine cells horizontally.

Ans. Rowspan

5. align and valign are used with ……… tag to set alignment of data in a table.

Ans. <TD>

Very Short Answer Type Questions


Q.1. what attribute will used when the CAPTION tag to put the table description at the bottom of the
table?

Ans. align=”attribute will be used when the CAPTION tag to put the table description at the bottom of
the table.

Q.2. where is the text specified in the <caption> tag displayed?

Ans. the text specified in the <caption> tag is displayed at center with respect to the table.

Q.3. differentiate between <TH> and <caption> tags.

Ans. <Th> tag encloses the header object and makes the data bold face and center aligned while
<caption> tag is used to provide a text to the table so as to explain the contents of the table. it is
generally in bold, at center with respect to the table.

Q.4. how <TD> and <TR> are different from each other?
Ans.TR tag is used to define rows In a table. table rows are divided into table data with the <tb> tag. The
TD keeps the data in regular font & left align by default.

Q.5. which attribute of the <table> tag merges rows vertically?

Ans. Rowspan attribute of the of the <table> tag merge rows vertically.

Q.6. write the code to align the contents of the cell to the top.

Ans. <TD VALIGN=”TOP”>

Q.7. what is the code to set the row with height 20% of the table?

Ans. <TR HEIGHT = 20%”>

Q.8. which tag is used to create a:

(i) table row

(ii) table data

Ans. (i) table row - <TR>

(ii) table data - <TD>

Q.9. name the attributes used to set the following in a table:

(i) background colour

(ii) table border

(iii) table width and height

Ans. (i) background color – bgcolor

(ii) table border – border

(iii) table width and height – width & height

Q.10.write the HTML code to set the background color of cells.

Ans. <THBGCOLOR = “RED”>


Q.11. what is the role of <cation> tag?

Ans. the <caption> tag is used to specify the title for the table.

Q.12. what is the role of align attribute in <TABLE> and <TR> tag?

Ans. align attribute controls the text alignment within the cell, either horizontally or vertically.

Q.13. give two attributes of table element of HTML.

Ans. ALIGN, BGCOLOR, BORDER,

Q.14. which HTML tags are used for marking a table and adding rows in a HTML documents?

Ans. (i) <Table> </table> tag are used for making a table.

(ii) <TR> </TR> are used for adding rows in a HTML a table.

Q.15. which attribute is used to control the inside table border?

Ans. RULES attribute is used to control the inside table border.

Short Answer Type Questions

Q.1 what are the attributes of <table> tag?

Ans. align-defines the alignment of a table and table cell. Values – left, center, right. – used with to align
cell contents.

Bgcolor- specifies the color for the table.

Width- specifies the width for the table in pixels or %

Border- specifies the border for the table.

Values – 0 or 1

Cellpadding- specifies the distance between adjacent cells.

Q.2. what does ‘n’ stand for in the following tags?

(a) <table border=n> (b) <table bgcolor=”n”>

(c) <td bgcolor=”n”> (d) td width = n>


(e) <a href = “n”>

Ans. <table border=n>: here is any numerical value 1,2,3, etc. which specifies table border boldness.

(b) <table bgcolor=”n”>: here n stands for any color name/hex color code/rgb code which provides
background color to table.

(c) <td bgcolor=n”n”>: here n stands for any color name /hex color code/rgb code which provides
background color to cell.

(d) <td width=n>: here n is any numerical value 1,2,3 etc. which specifies table cell with width.

(e) <a href=”n”>: here n stands for any URL.

Q.3. write down the difference between Cellspacing and cellpadding.

Ans. cellspacing: this attribute is used to set the minimum distance between two adjacent cells
cellspacing is the number of pixels between the table cells.

Cellpadding: this tag sets the margin within a cell, it is the pixel space inside the cells, i.e. the distance
between the cell content and the cell boundary.

Q.4. differentiate between the border and bordercolor attributes of the <table> tag.

Ans. border: this attribute draws a border around the table. it specifies the width of the border of a
table. if a table border is not given or its value of zero, then no border will be displayed there.

Bordercolor: this attribute is used to set the border color of a table. the default color of the border is
gray, but we can change it by assigning different color name to bordercolor attribute.

Q.5. what do you understand by colspan and rowspan?

Ans. colspan: it is used to combine cells horizontally. It specifies the number of columns that the cell
spans across and shows them as a single cell.

Rowspan: it is used to combine cells vertically. It merges the number of cells vertically and shows them
as a single cell.

Q.6. write the code to generate the following THML tables:

(i)

1 2 3
4 5 6
(ii)
1 2
3
Ans. (i) <html> <body>

<table border=1><tr>

<td rowspan=1><br></td>

<td rowspan=1><br>5<br></td>

<td rowspan=1><br>3<br>6</td>

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

(ii) <html> <body>

<table border=1>

<tr><td rowspan =2>1</td>

<tr> <td>3</td></tr></table>

<td>2</td></tr>

<tr><td>3</td></tr></table>

</body></html>

Q.7. differentiate between the <TR> and <TD> tags of HTML with the help of an appropriate example.

Ans. <TR> defines table row whereas, <TD> defines table data (cell).

Example:

<HTML>

<BODY>

<TABLE BORDER=1>

<TR>

<TD>1</TD>

<TD>2</TD>

</TR>

</TR> <TD>3</TD>

<TD>4</TD>

</TR>
<TABLE>

<BODY>

<HTML>

Q.8. What is the difference between the <TD> and <TH> tags?

Ans. <TD> is table data cell which aligned the text left by default in regular go it while <TH> is table
header which aligned the text center by default in bold face.

Q.9. explain align and bgcolor attributes of the <TR> tag?

Ans. align- aligns the content in a table row bgcolor-specifies a background color for a table row.

Q.10. mention the tags that are required to be used to create the given table.

Student details
Name age Gender
Nishi 14 Female
rajat 16 Male
Ans. <TABLE>, <TD>, <TH>, <TR>

Q.11. how can you specify following in a table?

(i) background image (ii) background color (iii) table height (iv) table width

Ans. (i) (TABLE CACKGROUND =”D”:/Bg3jbg”>

(ii) TABLE BGCOLOR = “RED”>

(iii) TABLE HEIGHT = 100>

(iv) TABLE WIDTH = 70>

Q.12. name the attributes used for following?

(i) setting the cell width

(ii) setting cell’s background image

(iii) setting cell’s background color

(iv) changing the cell span

(v) aligning cell contents vertically.


Ans. (i) WIDTH

(ii) BACKGROUND

(iii) BGCOLOR

(iv) ROWSPAN AND COLOSPAN

(v) VALIGN

Q.13. write the code to generate the following HTML tables:

(i)

A B
C
(ii)

A D
B E
C F
Ans. (i) <html>

<body>

<table> border=1>

<tr>

<td rowspan=”2”align=”center”>A</td>

<td>B</td.

</tr>

<tr>

<td> C </td>

</tr>

</table>

</body>

</html>

(ii) (i) <html>

<body>

<table> border=1>
<tr>

<td>A</td>

<td>D</td>

</tr>

<tr>

<td>B</td>

<td>E</td>

</tr>

<tr>

<td> C </td>

<td>F</td>

</tr>

</table>

</body>

</html>

Q.14. write the code to generate below tables in HTML.

A C E
B D F

A B C D
B D F H
Ans. (i) (i) <html>

<body>

<table> border=”1” frame=”lhs”>

<tr>

<td> A </td>

<td> C </td>

<td> E >/td>

</tr>
<tr>

<td> B </td>

<td> D </td>

<td> F </td>

</tr>

</table>

</body>

</html>

(ii) (i) <html>

<body>

<table> border=1>

<tr>

<td> A </td>

<td> B </td>

<td> C </td>

<td> D </td>

</tr>

<tr>

<td> B </td>

<td> D </td>

<td> F </td>

<td> H </td>

</tr>

<table>

</body>

</html>

Q.15. below are tables for which generate HTML code.


A B C
D E F
(ii)

A B C D
E F G H
Ans. (i) <html>

<body>

<table frame = “box” rules=”cols”>

<tr>

<td> A </td>

<td> B </td>

<td> C </td>

</tr>

<tr>

<td> D </td>

<td> E </td>

<td> F </td>

</tr>

</table

</body>

</html>

(ii) (i) <html>

<body>

<table frame=“box” rules=”groups”>

<tr>

<td> A </td>

<td> B </td>

<td> C </td>

<td> D </td>

</tr>
<tr>

<td> E </td>

<td> F </td>

<td> G </td>

<td> H </td>

</tr>

</table

</body>

</html>

Q.16. Ms. Heard girl of the school, has to display the sequence of events of upcoming school’s a annual
day function on the school website. Help her in writing HTML code to create a table in HTML, as shown
in the given screenshot.

ANNUAL SPORT DAY – SEQUENCE OF EVENTS


8:00 – 9:00 AM 9:00 AM 1:00 PM 1:00 – 2:00 PM
OPENING CEREMONY PRIZE DISTRIBUTION CULTURAL EVENTS
Ans. <THML>

<BODY>

< TABLE BORDER = “2” <TR> <TH COLSPAN = “3”> ANNUAL SPORT DAY – SEQUENCE OF EVENTS

</TH> </TR>

<TR ALIGN = “CENTER”><TD> 8:00 – 9:00 AM </TD> 9:00 – 1:00 PM </TD> <TD> 1:00 PM – 2:00 PM
</TD> </TR>

<TR ALIGN=”CENTER”> <TD> OPENING CEREMONY </TD> <TD> PRIZE DISTRIBUTION </TD>

<TD> CULTURAL EVENTS </TD></TR>

</TABLE></BODY></HTML>

Long Answer Type Questions

Q.1. write output of the following HTML code:

<html><head><title>

Table

</title>
</html>

<body>

<table border=”1”>

<tr> <th align=”center” rowspan=”3”>

One </th>

<th> two <th>

<th> three <1th> </tr>

<tr><td> rose </tr>

<td> lily </td> </tr>

<tr> <td> align=”center”>pansy </td>

<td align=”center”> dahlia </td></tr>

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

Ans.

TWO THREE
ONE Rose Lily
pausy Dahlia

Q.2. observe the following table and write the HTML code to generate it:

Ans. <html><head><title> table

</title></1head>

<body>

<table border=”1”>

<tr><th align =”center” rowspan=”2”>

Serial no </th>

<th <rowspan=”2”>class</th>

<th colspan=”3”>number of students

</th></tr>

<tr> <td>English </td> <td> Hindi </td>


<td> regional</td></tr>

<tr align=”center”><td align=”center”>1

</td> <td align=”center”XA</td>

<td>35</td><td>10</td><td>6</td></tr>

<tr alin=”center”<td align=”center”>2

<td><td align = “center”> XB</td>

</td>31</td><td>15</td><td>4</td>

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

Q.3. observe the below HTML table and write code in generate it

Ans. <HTML>

<DEAD>

<TITLE>marks </TITLE>

</HEAD>

<BODY>

<Table border=”3”>

<tr>

<th><bgcolor=”yellow”>marks</th>

</tr>

<tr bgcolor=”green”>

<th> English</th>

<th>math</th>

<th>economics</th>

</tr>

<tr>

<TD>67</TD>

<TD>77></TD>
<TD>92</TD>

</tr>

</table>

</body>

<html>

Q.4. write the HTML code to generate the following output of a table content exactly is the same format
as shown in the table:

ADMNO SNAME NAME DOB Opening


balance
1110 MANJIT RANJIT 4-MAR-1988
Ans. <HTML> <BODY>

<TABLE BORDER = 2 WODTH = 500>

<TR ALIGN = “CENTER” VALIGN = “MIDDLE”>

<TH> ADMNO </TH>

<TH> SNAME </TH>

<TH> NAME </TH>

<TH> DOB </TH>

<TH> opening balance </TH> </TR> <TR align = “center” valign = “middle”>

<TD> 1110 </TD>

<TD> MANJIT </TD>

<TD> RANJIT </TD>

<TD> 4-MAR-1988 </TD></TR></TABLE>

</BODY></HTML>

Q.5. write the HTML code to generate the following output.

Ans. <HTML>

<HEAD>

<TITLE> eat healthy live healthy </title>

</HEAD>
<BODY LINK = “Green” ALINK = “blue” VLINK = “RED”>

<CENTER>

<H1> <FOUNT COLOR = “maroon”> KHAO PIYO RESTAURANT </FONT></H1>

</CENTER>

<IMG SRC = “Restaurant.jpg” ALLGN = “right” HEIGHT = 200 WIDTH = 225>

<FONT COLOR = “purple” SIZE = 4> Collect information for: <UL>

<LI> <A HREF = “one html”>menus </A>

<LI> <A HREF = “two html”> TESERVATION</A><LI> <A HREF = “three html”>catering</A>

<LI> <A HREF = “four.html>tours</a>

</UL>

</FONT>

<CENTER> <CAPTION><FONT COLOR = “BLUE” menus available are: </FONT> <CAPTION>

<TABLE BORDER = 2 BORDERCOLOR = “blue”

<TR> <TD>1</TD><TD> INDIAN</TD></TR>

<TR> <TD>2</TD>ITLIAN </TD></TR>

<TR>3</TD><TD>CONTINENTAL</TD> </TR>

<TABLE>

</CENTER>

<FONT SIZE = 4>

<BR>

For further enquiries and reservations <A HREF = “mail to:[email protected]”>

Contract us: </A>

</FONT>

</BODY>

</HTML>

Q.6. write HTML code to generate code for your school timetable.

Ans. <html>

<body>
<h4> school timetable:</h4>

<table border:”1”>

<tr>

<th colspan=6> time table <th>> </tr>

<tr> <th rowspan = 6> hours </th><th> MON </th><th> TUN </th>

<th> WEB </td><td> eng</td><td>

Science </td><td>arts</td><td>social</td></tr>

<tr> <td> lang </td> math </td><td>computer </td><td> science </td> <td>

Music </td></tr>

<tr><th colspan =5> lunch </th> </tr>

<tr><td> science</td><td> games</td><td>lang </td><td> maths</td><td> maths </td><tr>

</table>

<body>

<html>

Q.7. write the HTML code using table tag for the following browser vies:

Ans. <html><body><table width = “100%” border = “1”>

<tr> </tr> colspan = 3> student details <th>savings </th>

<th> saving for holiday </th> </tr>

<th> <td> January </td> <td?> $80 </td> <td> $10</td> </tr>

</table>

</body></html>

Q.8. explain the following tags:

(i) <TABLE>

(ii) <TR>
(iii) <TD>

(iv) <CELLSPACING>

(v) <CAPTION>

Ans. (i) <TABLE>: this tag is used to create a table in HTML.

(ii) <TR>: this tag defines each horizontal row of table cells inside a table.

(iii) <TD>: this tag defines each table data cell within a row, into which text and/or graphics images may
be placed.

(iv) <CELLSPACING>: it is used to create space around the table cells.

(v) <CAPTION>: when text is enclosed in the <CAPTION> ……. </CAPTION> command, it will be displayed
above the table, centered and wrapped if necessary.

Q.9. carefully study the web page given below. Identify 10 tags that have been utilized in creating this
web page and write their usage:

Ans. <HEAD>: the <HEAD> element carries information about the HTML web page, such as title of the
web page.

<TITLE>: the <TITLE> tag is used to assign the name to a web page.

<BODY>: the <BODY> tag is placed just after the </HEAD> tag.

<B>: it is used to bold the text.

<FONT>: it is used to change the font style of the tag.

<HR>: it is used to make the horizontal rule on the web page.

<IMG>: it is used to display image on the web page.

<TABLE>: it is used to create table on the web page.

<BR>: it is used to break the text.

<CENTER>: it is used to align the text in the center of the web page.

Download other chapter's solutions

cbsepractice.in

You might also like