Web Technology Questions and Answers – Table Elements and Attributes

This set of Web Technology Multiple Choice Questions & Answers (MCQs) focuses on “Table Elements and Attributes”.

1. Can a whole table be inside a cell?
a) Yes, it can be placed
b) No, it cannot be placed
c) It can be placed at most in 2 cells
d) Only one table can be a placed in a table
View Answer

Answer: a
Explanation: You can put a whole table inside a single cell of another table (or inside other block – level elements), and if a table is contained within another element, the align attribute will indicate whether the table should be aligned to the left, right, or center of that element.

2. What is clear attribute(deprecated)?
a) Makes all the values in table to null
b) Helps to clear the previous data
c) Indicates how the browser should display the next line after the line break
d) Indicates the browser to clear the data
View Answer

Answer: c
Explanation: With the value of left, the text can begin only when there is nothing positioned on the left margin of the browser window (or containing element). If you do not want the text to flow around the table, you can use the CSS clear property on the element.

3. The value of color digital-code contains how many digits?
a) Hex-code, six digits
b) Octa-code, eight digits
c) Quad-code, four digits
d) tri-code, three digits
View Answer

Answer: a
Explanation: The bgcolor attribute sets the background color for the table. The value of this attribute can be a color name. It can also be a value of number with a six – digit code known as a hex code.

4. What does a cellpadding attribute (deprecated) do?
a) Creates a gap between two cells
b) Creates a gap between the edges of a cell and its contents
c) Creates a gap between two contents of a cell
d) It joins two or more cells together
View Answer
Answer: a
Explanation: The value for this attribute determines the amount of space or padding inside each wall of the cell, specified either in pixels or as a percentage value. And the percentage is a percentage of the width of each cell. The syntax of cellpadding is cellpadding=”5” or cellpadding=”2%” .
advertisement
advertisement

5. What is cellspacing attribute(deprecated)?
a) Creates a space between the borders of each cell
b) Creates a space between two rows
c) Creates a space between two cells in different tables
d) Creates a space between two columns
View Answer

Answer: a
Explanation: The value for this attribute can be either the amount of space you want to create between the cells, in pixels, or a percentage value. The syntax of cellspacing is cellspacing=”6” or cellspacing=”2%”. This attribute has been replaced by the margin property in CSS.

6. What is dir attribute?
a) Used to set a directory for a table
b) Indicates the direction of text used in the table
c) Shows the path set to the table
d) Shows/To set the default directory for the table
View Answer

Answer: b
Explanation: Possible values are ltr for left to right text and rtl for right to left (for languages such as Hebrew and Arabic).The syntax is dir=”rtl”. If you use the dir attribute with a value of rtl on the <table> element, then the cells appear from the right first, and each consecutive cell is placed to the left of that one.

7. If border attribute and frame attribute are used at once, which of them would take precedence over the other?
a) Border attribute
b) Frame attribute
c) No precedence over the other
d) Cannot tell
View Answer

Answer: b
Explanation: The frame attribute is supposed to control the appearance of the outermost border of the whole table, referred to here as its frame, with greater control than the border attribute. If both the frame and border attributes are used, the frame attribute takes precedence.

8. Which of the following is not a value for Frame attribute?
a) Above
b) Void
c) Null
d) Box
View Answer

Answer: c
Explanation: Null is not a value for Frame attribute. The purpose of void is -No outer border (the default). The purpose of above is to apply the border on the top only. The purpose of box is to apply border on all sides.
advertisement

9. How can a rule attribute (deprecated) be helpful?
a) To check If all the attributes belonged to the right place
b) To check the number of semantics followed
c) To check if all the attribute obeyed the rules specified for a particular snippet in the code
d) To indicate which inner borders of the table should be displayed
View Answer

Answer: d
Explanation: You can just specify that the rows or columns should have lines between each of them. Here is the syntax; rules=” ruleType. The default value for rule is none. It has been deprecated in favor of the CSS border property, which achieves better results.

10. How many attributes can a <tr> carry ?
a) 1
b) 3
c) 5
d) 7
View Answer

Answer: c
Explanation: The < tr > element is used to contain each row in a table. Anything appearing within a < tr > element should appear on the same row. It can carry five attributes, three of which have been deprecated in favor of using CSS. The attributes are align, bgcolor, char, charoff, valign.
advertisement

11. What is axis attribute?
a) It allows you to add conceptual categories to cells
b) It allows you to fix a standard cell which can act as a major source to many other cells
c) It allows you to easily find a cell by entering its coordinates as values
d) It allows you to use a set of cells as reference to another set of cells
View Answer

Answer: a
Explanation: The value of this attribute would be a comma – separated list of names for each category the cell belonged to. The syntax is axis=” heavy, old, valuable”. Rather than having a visual formatting effect, this attribute allows you to preserve data.

12. Which can possibly not be a value of scope attribute?
a) row
b) col
c) rowgroup
d) colgroup
View Answer

Answer: d
Explanation: The scope attribute can be used to indicate which cells the current header provides a label or header information for. It can be used instead of the headers attribute in basic tables, but does not have much support.

13. Which element to used to give title to a table?
a) Title
b) Heading
c) Headline
d) Caption
View Answer

Answer: d
Explanation: By using a <caption> element, rather than just describing the purpose of the table in a previous or subsequent paragraph, you are directly associating the content of the table with this description- and this association can be used by screen readers and by applications that process web pages (such as search engines).

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.