Loading...
Please wait while we prepare your content
Please wait while we prepare your content
Solutions for Computer Applications, Class 10, CBSE
Which attribute is used to combine the cells of a table vertically?
Rowspan
What is the default border colour of an HTML table?
Gray
Name the attribute which is used to set the background image for the table.
Background
Name the tag used to group header rows, that defines a table header.
<THEAD>
tag
Name the link that allows visitors to send an e-mail message quickly.
"mailto" link
Which attribute of <A>
tag specifies the name of the anchor being set up?
Name
When creating a web document, which unit is used to express an image's height and width?
Integer or percentage value
Which type of image is not shown automatically with other content on the web page?
External image
Mention the HTML tag to left-align the content inside a table cell.
<TD ALIGN = "LEFT">
Raveena wants to insert an image on her web page and align it in the center. She has written the following code to center-align the image, but the desired result is not displayed. Can you tell her what is wrong with her code?
<IMG Src= "SAVETIGER.GIF" Align= "Center">
The Align attribute cannot be used to center-align the image horizontally. The middle value of align attribute center aligns the image vertically with the current line but not horizontally. It can be done by using the Center element. Thus, the HTML code should be as follows:
<CENTER>
<IMG Src= "SAVETIGER.GIF">
</CENTER>
Shagun wants to set different background colours for the individual cells of the table. How can she achieve this?
We can use the 'bgcolor' attribute of the <TD>
element to give different colours to the cells of a table. Consider the following example,
<TABLE>
<TR>
<TD BGCOLOR = "YELLOW"> Cell 1 </TD>
<TD BGCOLOR = "PINK"> Cell 2 </TD>
</TR>
<TR>
<TD BGCOLOR = "BLUE"> Cell 3 </TD>
<TD BGCOLOR = "GREEN"> Cell 4 </TD>
</TR>
</TABLE>
Shivam has been given an assignment by her class teacher to design a table in such a way that the amount of space between its cell borders and cell data is 5 pixels and distance between any two cells is 3 pixels. Which attributes can she use to accomplish the task?
Shivam can use Cellspacing attribute of <TABLE>
element to set the distance between any two cells and Cellpadding attribute of <TABLE>
element to set the amount of space between its cell borders and cell data. Consider the following example,
<TABLE BORDER = "1" CELLSPACING = "3" CELLPADDING = "5">
<TR>
<TD> Fruits </TD>
<TD> Vegetables </TD>
</TR>
<TR>
<TD> Mango</TD>
<TD> Potato</TD>
<TR>
<TD>Guava </TD>
<TD>Aubergine </TD>
</TR>
<TR>
<TD>Banana </TD>
<TD>Cauliflower </TD>
</TR>
</TR>
</TABLE>
Ayush has to display the sequence of events of the upcoming Annual Sports Day on the school website. Help Ayush in writing the HTML code to generate the following output.
<HTML>
<HEAD>
<TITLE>Annual Sports Day</TITLE>
</HEAD>
<BODY>
<TABLE BORDER = "2" CELLPADDING = "5">
<TR>
<TH ALIGN = "CENTER" BGCOLOR = "MAGENTA" COLSPAN = "3">ANNUAL SPORTS DAY - SEQUENCE OF EVENTS</TH>
</TR>
<TR>
<TD BGCOLOR = "LIGHTPINK">8:00 am - 9:00 am </TD>
<TD BGCOLOR = "LIGHTPINK"> 9:00 am to 1:00 pm</TD>
<TD BGCOLOR = "LIGHTPINK"> 1:00 pm - 2:00 pm</TD>
</TR>
<TR>
<TD BGCOLOR = "ORANGE">CULTURAL EVENTS </TD>
<TD BGCOLOR = "ORANGE">TRACK EVENTS </TD>
<TD BGCOLOR = "ORANGE">PRIZE DISTRIBUTION </TD>
</TR>
</TABLE>
</BODY>
</HTML>
Consider the web page given below and answer the following questions:
<IMG>
tag is used to wrap the text around the image?The tags used to create a table pointed by the letter A are <TABLE>
, <TR>
and <TD>
.
The 'align' property of <IMG>
tag is used to wrap the text around the image. In this case, Align = "Right"
is used that places the image against the right margin and wraps the text around the left margin of the image.
We use the <P>
tag and its 'align' attribute to set the alignment of text pointed by the letters B and D.
The anchor tag <A>
is used to create the links pointed by the letter C.
Identify the errors in the following HTML code and write the corrected code with each correction underlined.
<HTML>
<HEAD> IMAGES</TITLE>
<BODY BACKGROUND="Red">
<IMG HREF="abc.jpg">HERE IS MY IMAGE FILE
</HEAD> </HTML>
The given HTML code has the following errors:
<HEAD> ... </HEAD
tag must be placed above the <BODY>
tag.<TITLE>
tag is missing its opening tag.<IMG>
tag should be used to define the image file to be displayed.<BODY>
tag is not closed i.e., </BODY>
tag is missing.The correct HTML code is as follows:
<HTML>
<HEAD>
<TITLE> IMAGES </TITLE>
</HEAD>
<BODY BACKGROUND = "Red">
<IMG SRC = "abc.jpg"> HERE IS MY IMAGE FILE
</BODY>
</HTML>
Gaurav, a web designer in a company named "International Designers" has just created a webpage in which different sections of the webpage are linked and can be traversed by clicking on the text given as "Top", "Middle", and "Bottom". Is it internal linking or external linking and why? Additionally, tell him about the suitable tag and its attribute(s) to open another webpage named 'second.html' by clicking on the text "Next".
Gaurav has used internal linking to link different sections of the webpage such that they can be traversed by clicking on the text given as "Top", "Middle", and "Bottom".
Internal linking involves creating links within the same website or webpage to navigate between different sections or pages of that same website or webpage. In this case, the links are used to move within the current webpage to different sections, so it is called internal linking.
Gaurav can use the anchor tag <A>
tag with its attribute 'href' to open another webpage named 'second.html' by clicking on the text "Next". He can use the following HTML code,
<A HREF = "second.html"> Next </A>
The height attribute specifies the height of an image in the form of an ............... or a percentage value.
The height attribute specifies the height of an image in the form of an integer or a percentage value.
............... attribute of an image tag controls the vertical space around the image.
Vspace attribute of an image tag controls the vertical space around the image.
............... is an attribute of the <IMG> tag which specifies the location or URL of the image to be displayed.
Src is an attribute of the <IMG> tag which specifies the location or URL of the image to be displayed.
An image to be displayed on a web page has to cover 25% of the browser window horizontally and 50% vertically. The attributes ............... and ............... of the <IMG> tag would be used for achieving this.
An image to be displayed on a web page has to cover 25% of the browser window horizontally and 50% vertically. The attributes Height and Width of the <IMG> tag would be used for achieving this.
The ............... tag is used to create inline images.
The <img> tag is used to create inline images.
An ............... link allows a link to another section on the same web page.
An internal link allows a link to another section on the same web page.
The three values of the VAlign attribute, used with <TD> tag, are ..............., ............... and ............... .
The three values of the VAlign attribute, used with <TD> tag, are Top, Bottom and Middle.
Tables arrange data in ............... and ............... .
Tables arrange data in Rows and Columns.
The ............... attribute of the <TABLE> tag is used to set the minimum distance between two adjacent cells.
The Cellspacing attribute of the <TABLE> tag is used to set the minimum distance between two adjacent cells.
The default border size of a table is ............... pixel.
The default border size of a table is one pixel.
The Border attribute of a table specifies the ............... of the border of a table.
The Border attribute of a table specifies the width of the border of a table.
The <TD> tag must always be present inside the ............... tag.
The <TD> tag must always be present inside the <TR> tag.
How can you add space around the top and bottom of an image?
We can use the Vspace attribute to add space around the top and bottom of an image. The value of Vspace is defined in pixels.
For example,
<IMG SRC = "IMAGE.JPG" ALT = "GARDEN" VSPACE = "40">
How will you add border to an image?
We can add border around the image by using the Border attribute. It accepts value in terms of pixels.
For example,
<IMG SRC = "IMAGE.jpg" Border= "5">
Differentiate between the Rowspan and Colspan attributes of a table.
Differences between Rowspan and Colspan attributes of a table are:
S. No. | Rowspan | Colspan |
---|---|---|
1. | ROWSPAN is used to combine the cells vertically. It merges the number of cells vertically and displays them as a single cell. | COLSPAN is used to combine the cells horizontally. It specifies the number of columns that the cells span across and shows them as a single cell. |
2. | E.g. <TD Rowspan= "3"> where 3 is the number of rows that the cells span across. | E.g. <TD Colspan= "4"> where 4 is the number of columns that the cells span across. |
How is spacing in cells controlled?
Spacing in cells is controlled by the following attributes of the <TABLE>
tag.
Consider the following example,
<TABLE BORDER = "3" CELLSPACING = "1" CELLPADDING = "1">
<TR>
<TD> Fruits </TD>
<TD> Vegetables </TD>
</TR>
<TR>
<TD> Mango, Apple, Banana </TD>
<TD> Potato, Aubergine, Gourd </TD>
</TR>
</TABLE>
How will you add an image of a table at the top of your web page?
We can use the <IMG>
tag with its attribute 'src' to add an image of a table at the top of our web page. The HTML code is as follows:
<HTML>
<HEAD>
</HEAD>
<BODY>
<IMG SRC = "TABLE.JPG" ALT = "IMAGE OF A TABLE">
...contents of the web page...
</BODY>
</HTML>
Write the HTML code to:
i. Align the content of a cell in a Table to the top
ii. Link to a specific section of another webpage
i. To align the content of a cell in an HTML table to the top, we can use the 'valign' attribute with the value "top" for the <td>
element. Consider the given example,
<TABLE>
<TR>
<TD VALIGN = "TOP"> Mouse </TD>
<TD>Monitor </TD>
</TR>
<TR>
<TD>Keyboard </TD>
<TD>Printer </TD>
</TR>
</TABLE>
ii. To create a link to a specific section of another webpage, we can use anchor tags <a>
with the 'href' attribute pointing to the target webpage and specifying the target section using a '#' followed by the section's 'name' attribute. Consider the given example,
<a href="https://computerhardware.com#inputdevices">Input Devices</a>
Here, "inputdevices" is the value of the 'name' attribute which refers to a specific section of another webpage.
Write the HTML code to send an email to abc@xyz.com
from your web page.
<HTML>
<HEAD>
<TITLE>Send Email Example</TITLE>
</HEAD>
<BODY>
<A HREF = "mailto:abc@xyz.com">Send Mail to abc</A>
</BODY>
</HTML>
Create a table having four header rows with yellow background colour, four table body rows having light orange colour, and two footer rows having light green colour. Add table contents on your own.
<HTML>
<HEAD>
<TITLE>Table Example</TITLE>
</HEAD>
<BODY>
<TABLE>
<THEAD BGCOLOR = "YELLOW">
<TR> <TD> Names </TD> </TR>
<TR> <TD> Of </TD> </TR>
<TR> <TD> Some </TD> </TR>
<TR> <TD> Fruits </TD> </TR>
</THEAD>
<TBODY BGCOLOR = "ORANGE">
<TR> <TD> Apple </TD> </TR>
<TR> <TD> Mango </TD> </TR>
<TR> <TD> Banana </TD> </TR>
<TR> <TD> Guava </TD> </TR>
</TBODY>
<TFOOT BGCOLOR = "LIGHTGREEN">
<TR> <TD> Note </TD> </TR>
<TR> <TD> Fruits are rich in fibre. </TD> </TR>
</TFOOT>
</TABLE>
</BODY>
</HTML>
Which tag is used to insert an image in a web page?
<SRC>
<IM>
<IMG>
<IMG>
Reason — <IMG>
tag is used to insert an image in a web page.
Which attribute of the <IMG>
tag allows you to display a text instead of an image?
Alt
Reason — The Alt attribute can display a phrase instead of the image, in case the image cannot be displayed by the browser.
You can use the ............... attribute to control the horizontal space around an image.
Hspace
Reason — You can use the Hspace attribute to control the horizontal space around an image.
We can present data in a row and column format by using the ............... tag.
<TR><TC>
<TABLE>
<ROW><COL>
<TABLE>
Reason — We can present data in a row and column format by using the <TABLE>
tag.
The column heading is specified by using the ............... tag.
<CH>
<TR>
<TH>
<TD>
<TH>
Reason — The column heading is specified by using the <TH>
tag.
<TR>
tag is used to create a ............... in a table.
Row
Reason — <TR>
tag is used to create a row in a table.
............... tag defines the cells or columns of a table which denotes table data.
<TR>
<TD>
<TH>
<TD>
Reason — <TD>
tag defines the cells or columns of a table which denotes table data.
Which attribute is used to set the amount of space between the cell border and the cell data?
Cellpadding
Reason — Cellpadding attribute is used to set the amount of space between the cell border and the cell data.
The default alignment of the contents of table cells is ............... .
Left
Reason — The default alignment of the contents of table cells is left.
Choose the correct HTML code to right-align the data inside a table cell.
<TRright Align>
<TD Align ="Right">
<TD VAlign ="Right">
<TR "Right">
<TD Align ="Right">
Reason — To right-align the data inside a table cell, we use the given HTML code:
<TD Align ="Right">
Which is the correct code to merge four columns in a table?
<TD COLSPAN = 4>
<TD COLUMN SPAN= 4>
<COLSPAN = 4>
<TD SPAN = 4>
<TD COLSPAN = 4>
Reason — The correct HTML code to merge four columns in a table is as follows:
<TD COLSPAN = 4>
Which of the following is not the attribute of <A>
tag?
SRC
Reason — SRC is not the attribute of <A>
tag. The other attributes of <A>
tag are used for the following purposes:
Combining two or more cells either column-wise or row-wise in a table is called ............... .
Spanning
Reason — Combining two or more cells either column-wise or row-wise in a table is called Spanning.
The two common attributes of the <IMG>
and the <TABLE>
tags are ............... .
They do not have any common attributes
Reason — The <IMG>
and the <TABLE>
tags do not have any common attributes.
Why is it important to specify width and height attribute in <IMG>
tag?
Helps the browser to load the web page faster.
Reason — It is important to specify width and height attribute in <IMG>
tag so that the browser can reserve the space for the images when the page is loaded.
Which command should we use to link a page with an HTML page?
<A Link= "page.htm"> </a>
<A Href = "page.htm">page</a>
<A Connect= "page.htm"></a>
<A Attach="page.htm" > </a>
<A Href = "page.htm">page</a>
Reason — We can use the following command to link a page with an HTML page :
<A Href = "page.htm">page</a>
Which attribute(s) is/are used to merge rows?
Rowspan
Reason — Rowspan attribute is used to merge rows.
What is the correct syntax in HTML for creating a link to an e-mail address?
<A Href = "E-mail.htm">
<A e-mail:to@address>
<A Href="mailto:e-mail_id">
<A Href="mailto:e-mail_id">
Reason — The correct syntax in HTML for creating a link to an e-mail address is as follows:
<A Href="mailto:e-mail_id">
What do you understand by Alternate text?
Alternate text is the text that is displayed as an alternate to the image when the browser is not able to display the image. It is specified using the Alt attribute of <IMG>
tag.
Differentiate between <TH>
and <THEAD>
tag.
<TH> tag | <THEAD> tag |
---|---|
<TH> tag is used to specify column heading by making the heading text bold. | <THEAD> tag is used to group header rows that define the table's header. The table header defined by the <THEAD> tag will appear on each page of the document where the table is displayed. |
<TH> tag should be enclosed within <TR> tag. | <THEAD> tag should be enclosed within <TABLE> tag. |
For example, <TABLE> <TR> <TH BGCOLOR = "PINK">Input Devices</TH> <TH BGCOLOR = "PINK">Output Devices</TH> </TR> <TR> <TD>Mouse </TD> <TD>Monitor </TD> </TR> <TR> <TD>Keyboard </TD> <TD>Printer </TD> </TR> </TABLE> | For example, <TABLE> <THEAD BGCOLOR = "PINK"> <TR> <TD>Input</TD> <TD>Output</TD> </TR> <TR> <TD>Devices</TD> <TD>Devices</TD> </TR> </THEAD> <TR> <TD>Mouse </TD> <TD>Monitor </TD> </TR> <TR> <TD>Keyboard </TD> <TD>Printer </TD> </TR> </TABLE> |
Which tag in HTML is used to combine the cells vertically in a Table?
Rowspan attribute of <TD>
tag is used to combine the cells vertically in a Table.
Which tag is used to create a row in a Table?
<TR>
tag is used to create a row in a Table.
Which sides of the Table's outside border would be visible by setting Frame = "Vsides".
The left and right sides (vertical sides) of the Table's outside border would be visible by setting Frame = "Vsides".
Mention the suitable HTML tag and the attribute to insert an image named 'globe.jpg' in the background of a webpage.
We can use the <BODY>
tag with the BACKGROUND attribute to insert an image named 'globe.jpg' in the background of a webpage.
E.g. <BODY BACKGROUND = "GLOBE.JPG">
Mention any two attributes of <IMG>
tag along with their significance.
Two attributes of <IMG>
tag are as follows:
How can text be displayed in place of an image for users whose browsers do not support images?
We can use the Alt attribute of the <IMG>
tag to display text in place of an image for users whose browsers do not support images.
E.g.<IMG Src= "garden.jpg" Alt = "Image of a garden">
Name two common graphics file formats that most browsers recognise.
Two common graphics file formats that most browsers recognise are GIF and JPEG.
Name the attributes of <A>
tag which are used for internal linking in a web page.
The attributes of <A>
tag which are used for internal linking in a web page are:
Write names of two attributes each for the following tags:
(i) <Img>
(ii) <Table>
(iii) <A>
(i) <Img>
— Src, Alt
(ii) <Table>
— Bgcolor, Bordercolor
(iii) <A>
— Href, Name
Which tags divide HTML tables in multiple sections?
HTML tables can be divided into multiple sections by the following tags:
<THEAD>
— This tag is used to group header rows that define the table's header.<TBODY>
— This tag defines a table's body.<TFOOT>
— This tag defines a group of footer rows in a table.The <IMG>
tag is an empty element.
True
Reason — The <IMG>
tag is an empty element as it doesn't require a closing tag.
The Align attribute can be used to center-align the image horizontally.
False
Reason — The Align attribute cannot be used to center-align the image horizontally. It can be done by using the Center element.
The Alt attribute lets you specify text as an alternative to the image.
True
Reason — The Alt attribute can display a phrase instead of the image, in case the image cannot be displayed by the browser.
The Height Attribute of an image can only be specified in the format of a percentage value.
False
Reason — The Height Attribute of an image can be specified in the format of an integer or a percentage value.
The <TITLE>
tag is one of the structural tags of HTML documents.
True
Reason — The <TITLE>
tag is one of the structural tags of HTML documents and is defined inside the <HEAD>
tag.
The <TFOOTER>
tag is used to define a set of header rows.
False
Reason — The <THEAD>
tag is used to define a set of header rows.
The table row begins with a <T Row>
tag.
False
Reason — The table row begins with a <TR>
tag.
The <TH>
tag makes the text of the table heading bold.
True
Reason — The <TH>
tag makes the text of the table heading bold.
The Href attribute with <A>
tag is used to open a link in a new window.
True
Reason — The Href attribute with <A>
tag is used to open a link in a new window.
We can give different colours to each cell in a table.
True
Reason — We can give different colours to each cell in a table by using the Bgcolor attribute.
We can put a border around an image by using cellpadding attribute.
False
Reason — We can put a border around an image by using Border attribute of <IMG>
tag.
No value is specified with alt attribute of <IMG>
tag.
False
Reason — The value for the Alt attribute is a text string of up to 1024 characters, enclosed in quotation marks.
A table's background colour can be specified using bgcolor attribute.
True
Reason — A table's background colour can be specified using bgcolor attribute.
<CAPTION>
tag gives a description of the table.
True
Reason — <CAPTION>
tag gives a description of the table.
An image can be used as a hyperlink to another document.
True
Reason — An image can be used as a hyperlink to another document.