CSS Questions & Answers – Styling Tables

This set of CSS Multiple Choice Questions & Answers (MCQs) focuses on “Styling Tables”.

1. Which of the following element is used within the table element to define a caption?

a) <tablecaption>
b) <caption>
c) <table-cap>
d) <table-caption>
View Answer
Answer: b
Explanation: None.
 
 

2. Which of the following property is used to specify table borders in CSS?
a) table
b) border
c) table:border
d) none of the mentioned
View Answer

Answer: b
Explanation:

advertisement
advertisement
Example: table{border: 7px solid black;}

3. Which of the following property sets whether the table borders are collapsed into a single border or separated:?
a) border
b) border-collapse
c) collapse
d) table-border
View Answer

Answer: b
Explanation:

Note: Join free Sanfoundry classes at Telegram or Youtube
Example: table{ border-collapse: collapse;}

4. Which of the following property is used to change the width of table?
a) width
b) table
c) table-width
d) resize
View Answer

Answer: a
Explanation:

advertisement
Example: table{width: 23px;}

5. Which of the following property sets the vertical alignment?
a) align
b) vertical
c) vertical-align
d) vertical-alignment
View Answer

Answer: b
Explanation:

advertisement
Example: table{vertical-align: top;}

6. Which of the following property is used to control the space between the border and content in a table?
a) border
b) margin
c) padding
d) resize
View Answer

Answer: c
Explanation:

Example: table{border: 4px solid black;}

7. Which of the following property is used to change the background in a table?
a) table-background
b) background
c) color
d) none of the mentioned
View Answer

Answer: b
Explanation: None.

8. Which of the following property is used to change the height of a table?
a) height
b) table-height
c) resize
d) position-y
View Answer

Answer: a
Explanation:

Example: table{height: 45%;}

9. Which of the following property is used to align the text in a table?
a) align
b) text
c) text-align
d) none of the mentioned
View Answer

Answer: c
Explanation:

Example: table{text-align: left;}

10. Which of the following property is used to set order in a table?
a) border
b) padding
c) dotted
d) text
View Answer

Answer: a
Explanation:

Example: table{border: 1px solid #000;}

Sanfoundry Global Education & Learning Series – CSS.

To practice all areas of CSS, 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.