Web Technology Questions and Answers – Grouping Section of a Table

This set of Web Technology Multiple Choice Questions & Answers (MCQs) focuses on “Grouping Section of a Table”.

1. What is colspan attribute?
a) It joins two or more columns
b) It separates two or more columns
c) It allows to put an entire column in a cell
d) It allows to use a same column for two or more different reasons
View Answer

Answer: a
Explanation: The elements < td > and < th >, both can carry an attribute called colspan that allows the table cell to span (or stretch) across more than one column. An example of where the colspan attribute might be useful is in creating a timetable or schedule where the day is divided into hours.

2. Why is &nbsp character used in the cells?
a) It is used to extract the default value in the cell
b) It is used to create double tab space in the cell
c) So that the cell has some content
d) So that the cell has no content
View Answer

Answer: c
Explanation: It is called the non – breaking space character. It is included so that the cell has some content. Without content for a table cell, some browsers will not display the background color (whether that color is specified using CSS or the deprecated bgcolor attribute).

3. The elements used to split a table into Head, Body and Foot is ?
a) head, body, foot
b) thead, tbody, tfoot
c) ttitle, tbody, tend
d) caption, body, foot
View Answer

Answer: b
Explanation: Consider a bank statement: you may have a table where the header- column headings, the body- list of transactions, and the footer- the balance in the account. If the table is too long to show on a screen, then the header and footer might remain in view all the time, while the body of the table gains a scrollbar.
advertisement
advertisement

4. What is the position of tfoot in the source code?
a) It should be placed after the tbody
b) It should be placed before the thead
c) It should be placed before the tbody
d) It can be placed anywhere in the source code
View Answer

Answer: c
Explanation: It is just because of the semantics which one follow while writing the source code. A table may also contain several < tbody > elements to indicate different “ pages ,” or groups of data.

5. How is colgroup element different from colspan element?
a) To group/join already spanned columns together
b) To joins columns on a large scale
c) To verifies the wrong order of spanning of columns
d) To explain that the related columns are grouped together
View Answer

Answer: d
Explanation: The colgroup element explains about the related columns that they are grouped together. When the <colgroup> element is used, it comes directly after the opening < table > tag and carries a span attribute, which is used to indicate how many columns the group contains.

6. Why is the col element introduced?
a) Single column can act as source to many other columns
b) To create a column in a table
c) To specify attributes of the columns in a <colgroup>
d) To specify the elements in a <colgroup>
View Answer

Answer: c
Explanation: Unlike the < colgroup > element, the < col > element does not imply structural grouping and is therefore more commonly used for presentational purposes. The < col > elements are always empty elements, which means they do not have any content, although they do carry attributes.

7. Which of the following doesn’t help in making a table accessible?
a) Adding captions to your tables.
b) Using scope and header attributes
c) Using rowspan and colspan attributes
d) Always putting headings in the first row and the first column
View Answer

Answer: c
Explanation: Avoid using rowspan and colspan attributes, which again make it harder for the user with a screen reader to follow. If you do use them, make sure that you use the scope and headers attributes, which are discussed shortly.
advertisement

8. What is linearization of tables?
a) Grouping all the tables linearly so that one can be accessed after the other
b) Reading a row in a table from left to right before moving to the next row
c) Arranging the columns linearly in ascending or descending fashion
d) Reading a column in a table from top to bottom before moving to next column
View Answer

Answer: b
Explanation: When a screen reader is being used to read a table, it will tend to perform what is known as linearization, which means that the reader starts at the first row and reads the cells in that row from left to right, one by one, before moving on to the next row, and so on until the reader has read each row in the table.

9. Nesting of tables make them more accessible?
a) True
b) False
View Answer

Answer: b
Explanation: Nesting of tables make them less accessible. Avoid using nested tables as this will make it harder for the user of a screen reader to follow. Any number of tables can be nested in a single table though.
advertisement

10. What is valign attribute?
a) To provide vertical alignment for a column
b) To specify the vertical alignment for the content of the cell
c) To provide space/gap between two cells vertically
d) To specify the vertical alignment between to the two rows
View Answer

Answer: b
Explanation: The valign attribute allows you to specify the vertical alignment for the content of the cell. The possible values for the valign attribute are top, middle, bottom, and baseline. It is a deprecated value.

Sanfoundry Global Education & Learning Series – Web Technology.

To practice all areas of Web Technology, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.