Lists and Tables in HTML
(Q1) Fill in the blanks:-
(1) In word processors, we make use of Bullets and Numbering to make our lists either in
Numbered or Bulleted.
(2) In the HTML, to display the list of items on the webpage, we make use of List Tag.
(3) An unordered list is the collection of related items that have no special order.
(4) The <table> tag allows us to arrange the data into rows and columns.
(5) Caption tag is used to display the title for the table on the top.
(6) The space between the cells is called as Cell Spacing
(Q2) State whether the following statements are True or False:-
(1) <UL> tag is used to define the unordered list. True
(2) Disc, Circle and Square are the attribute types of the ordered list. False
(3) An ordered list is the collection of related items that are numbered. True
(4) Nested list means that one list can be placed inside the other list. True
(5) Cell spacing represents the distance between cell borders and the content within a
cell. False
(Q3) Answer the following questions in one or two sentences each :-
(1) What is the use of List tag in HTML
Ans :- If we have noticed that in different types of word processors, there is availability of
Bullets and Numbering which is used for creating the lists in the number or bullets form. So
in HTML, we make use of list tag, for showing the lists on our webpage.
(2) What do you know about Nesting list
Ans :- In the program of HTML, the lists can be nested i.e is lists inside list or one list can be
place inside the other list is to be termed as Nesting list. When we make use of the nesting
list, it is necessary to close the inner tags and the outer tags at the end.
(3) What is meant by Caption Tag
Ans :- Caption tag is used for giving the caption/heading to the table in a HTML program.
This tag performs the task of showing the title for the table on the top.
(4) Name the tags which are used for defining Table Row, Table Heading, Table Data
in HTML.
Ans:- The tags which are used for defining the following terms in HTML are as follow:-
Table Row – <TR> Tag
Table Heading – <TH> tag
Table Data – <TD> tag
(5) What is a Table tag? Explain its attributes?
Ans:- If we want to present the data in the tabular form on paper, then we draw rows and
columns on the paper, similar to it if we want to show any data in the tabular form in rows
and columns. We can easily create the table in HTM by using the <Table> tag.
<Table> tag is a container tag.
The attributes of a table Tag are as followed :-
Attribute Value Description
Bgcolor Color It specifies the background color for the table
It specifies whether the border is required
Border 0 or 1
around the table or not
It used for specifying the space between the
Cell padding Pixels
cell wall and cell content
Cell Spacing Pixels It specifies the space between the cells
Pixels
Height_width It specifies the height and width of a table.
%
(Q4) Answer the following questions :-
(1) State the difference between ordered list and Unordered list along with its
attribute.
Ans :- The difference between Ordered List and Unordered List are as follows :-
(a) Ordered List:- In this, the list of items will be displayed by using different forms of
numbers. In the HTML, to define the ordered list we make use of <OL> tag. In this list, the
list of items are been displayed with the numbers/alphabet. There is a need to mention the
<LI> tag at the front of every single item in the list. <OL> tag is the container tag which
means the list should end with the </OL>.
Attributes of Ordered List
Attribute Value Description
Start Number It states the starting value of an ordered list
Type 1 It states the form of numbering to be used in the list
(b) Unordered List :- In this list, the list of items will be displayed by using the plain
bullets. To define unordered list we make use of <UL> tag. In this order the items which are
related to each other does no have specific order. There is a need to mention the <LI> tag at
the front of every single item in the list. Disc is the by default bullet style. <UL> tag is the
container tag which means the list should end with the </UL>.
Attributes of Unordered List
Value Description
Disc A filed circle
Circle An untitled Circle
Square A filled square
(2) Explain the concept of Table Caption, Table Row, Table Heading, Table Data
Ans :- Some of the concepts are been explained below :-
(a) Table Caption :- In every table we have always seen caption/heading at the top of the
table which is easier in providing the clarity of the concept/contents of the table to the
reader. Like that we can also give the caption/heading to our table in HTML by making use
of the Caption tag. This Caption tag is specially made used for showing the table’s title at
the top.
(b) Table Row :- In the HTML table, the rows are been defined by using the <TR> tag. Such
type of tag is also a container tag which means <TR> tag ends with </TR>
(c) Table Heading :- Table heading is used for displaying the heading/title in the table in
dark bold letters/characters. Table heading is also a container tag and is defined by using
the <th> tag.
(d) Table Data :- In the HTML table, the contents/data inside the columns of a table can be
shown using the <td> tag. Table data is a containers tag. <tr> tag must contain <td> tag
within it.
(3) State the difference between Cell Padding and Cell Spacing.
Ans :- The difference between the Cell Padding and Cell Spacing are as followed :-
(a) Cell padding :- It is used to format the cells of the table look good by providing the
space within the cells. It defines the space/distance between the contents of the table and
the cell border in the table. 1 pixel is the by default cell padding. For ex:- <table
cellpadding=”5”>
(b) Cell Spacing :- This another type of attribute in the <table> tag. It is used to define the
space between the cells. It provides space outside the border of the cells in the table. By
default 2 pixel is cell spacing. For ex:- <table cell spacing “7”>. Below you may find the
figure showing the Cell padding and Cell spacing