Inserting Images and Creating
Tables in HTML 5
1. Fill in the blanks.
a. The________image format uses a maximum of 256 colors and a combination of these to create
more colors.
b. The src attribute of the________tag specifies the URL of an image.
c. The <img> tag is a/an________element.
d. The value of the height attribute of the <img> tag is specified
in___________
e.A_________arranges data in rows and columns.
f. The________tag indicates that the cell is a header for a column or a row.
g. The default value of caption-side property is__________
h. The____________property specifies the space between the border and content
in a table.
i. The value of src attribute is_____________
j. The___________ property sets the horizontal alignment of text in a table.
Answer:-
a. GIF (Graphics Interchange Format)
b. <img>
c. Empty
d. Percentage or Pixel
e. Table header <th>
f. Table
g. Top
h. Cell padding
i. URL
j.Text- Align
2. Write T for the True statement
and F for the False one. Correct the false statement(s).
a. Web browsers use only the GIF format.
b. PNG format works best for images with transparencies or low color count.
C. The <img> tag is an empty element.
d. The alt attribute cannot be used for the <img> tag.
e. The <td> tag specifies
f. The value of width attribute for the <img> tag can be specified in
pixels only.
g. The border properties can be used with <td> and <tr> tags.
h. The text-align property sets the horizontal alignment of text in a table.
i. Graphics can be inserted in a table cell using the <image> tag.
j. The default value of the border-collapse property is ‘separate’.
Answer:-
а. F
b. T
c. T
d. F
e. T
f. T
g. T
h. T
i. F
j. T
3. Choose the correct option.
a. The___________tag specifies an image to be displayed in an HTML5 document.
i.<img> ii. <image> iii. <imagehtml> iv. none of these
b. src is an attribute of the____ tag
i.<img> ii. <image> iii. <imagesource> iv. none of these
c. The vertical-align property of the <td> tag can have the value
i. top ii. bottom iii. middle iv. none of these
d. The___________attribute specifies an alternate text for an image
i. alternate ii. alter iii. alt iv. none of these
e. Which of the following is the best format for photographs?
i.PNG ii.JPEG iii.GIF iv. none of these
f. The main tag used to define a table in HTML5 is_________
i. <table> ii.くtd> iii.<tr> iv. none of these
g. Which of the following tags is used to define an individual block or cell in
a table row in an HTML5 document?
i. <table> ii.<tr> iii.くtd> iv. All of these
h. The default value of empty-cells property is
i. hide ii. show iii. separate iv. none of these
i. Which of the following properties are used with the <td> tag?
i. text-align ii. vertical-align iii. padding iV. All of these
Answer:-
a. <img>
b. <img>
h. Show
c. All of these
d. Alt
e. JPEG
f. <table>
g. <td>
h. Show
i. All of these
4. Short answer questions
a. Give the full form of GIF and PNG.
Ans: GIF :- Graphics
Interchange Format
PNG :- Portable Network Graphics.
b. Name the attribute of the <table> tag is used to define background
color.
Ans: The attribute of the
<table> tag that is used to define background color is
<table background = ‘black”>.
c. Expand the following:
i.<td> ii.<th>
Ans: i. <td> = Table data tag.
ii.<th> = Table header tag.
d. Name the tag used to define the title to the table.
Ans: The tag used to define the
title to the table is <caption> tag.
e. What is the use of <th> tag?
Ans: The table header
indicates that the cell is a header for a column or a row.
f. What are the values in which the width and the height property of a table
can be given?
Ans: The width and the height
property of a table can be given in percentage(%) or pixels(px).
eg:- Width: 100%, 200px
Height: 45%,170px
g. Which table property is used to specify the placement of a table caption?
Ans: Caption-side is the table
property used to specify the placement of a table caption.
h. What is the use of empty-cells property?
Ans: The use of empty-cells property
is that it specifies whether to display borders and background for empty cells
in a table or not.
i. Name the property used to set the vertical alignment of text in a table?
Ans: Vertical-align property is the
property used to set the vertical alignment of text in a table.
j. Can you insert an image in a table cell?
Ans: Yes, we can insert an image in
a table cell.
5. Long answer questions
a. Differentiate between GIF and JPEG formats.
Ans:
GIF
1. It contains 256 colors.
2. It displays images designed with a graphics program.
JPEG
1. It contains 1 million colors.
2. It does not displays images designed with a graphics program.
b. What is the use of <img> tag? Is it an empty or a container
element? Explain any two attributes used with this tag using an example.
Ans: The use of <img> tag is
that it specifies an image to be displayed in an HTML5 document.It is an empty
element as it have an OFF tag.
Two attributes are:-
(i) Src – It specifies the URL of an image file. Example :- <img src =
“picl.jpg”>
(ii)Height:- It specifies the height of an image. Example :- <img src =
“picl.jpg” height = “100”>
c. What is the difference between <tr> and <td> tags?
Ans: <tr> (Table Row Tag) :-
It defines a horizontal row of cells.
<td> <Table Data Tag):-It specifies an individual block or cell in a
table row.
d. What is the use of the following properties.
Ans: (i) Border-spacing: It
specifies the distance between the borders of the adjacent cells.
(ii) Caption-side:It specifies the placement of table caption.
(ii) Border-collapse: It specifies whether the table borders should be
collapsed or not.
e. How can we specify the height and width of the table?
Ans: We can specify the height and
width of the table by the height and width property of the table tag. Its
values are in percentage or pixels.
eg:- <table height = “170px”,width =”200%”>
f. Explain the border properties that can be used with the <table>
tag. Can you apply these properties to the <td> and <tr> tags?
Ans: The border properties that can
be used with the <table> tag are:-
1. Border-spacing:- It specifies the distance between the borders of adjacent
cells. Its values are in value1 and value 2(in px, cm, etc). eg:-
border-spacing: 7px, border-spacing: 10px 15px.
2. Border-collapse:- It specifies whether table borders should be collapse or
not. It values are in separate (default) collapse. eg:- border-collapse:
collapse.
Yes, we can apply these properties to the <td> and <tr> tags.
g. Differentiate between text-align and vertical-align properties. What
values can be assigned to
these properties?
Ans:
Vertical-align property
1. It sets the horizontal alignment of text in a table.
2. The value of this property is Left/Right/Center.
Text-align property
1. It sets the vertical alignment of Text-align property text in a table.
2. The value of this property is Top/Bottom/Middle.
h. Which properties will you use to change the background color and the text
color for the heading row?
Ans:We can use ‘background-color’
property to change the background color and ‘color’ property for the text color
for the heading row.
i. What is the use of the padding property? Which HTML tag uses this
property?
Ans: The padding property
specifies the space between the borders and contents in a table. Its values are
in pixels. The <td> HTML tag uses this property.
j. What is the use of the empty-cells property?What different values can be
assigned to this property?
Ans: The empty-cells property
specifies whether to display borders and background for empty cells in a table
or not.
The different values that can be assigned to this property are:- show (default)
and hide.