Web Technology Questions and Answers – Tables

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

1. What are tables in web programming?
a) Display information in rows and columns used to display all manner of data that fits in a grid
b) To only store data to be accessed later by the user
c) Containing more number of rows than columns
d) Display information which are already accessed by the user
View Answer

Answer: a
Explanation: Tables display information in rows and columns; they are commonly used to display all manner of data that fits in a grid such as train schedules, television listings, financial reports, and sports results.

2. Is a table similar to spreadsheet?
a) Yes, it is equivalent to the spreadsheet
b) Yes, they are similar to each other
c) No, they are made up of rows and columns
d) No, they are opposite to each other
View Answer

Answer: b
Explanation: Yes, they are similar to each other. Each rectangle is known as a cell. A row is made up of a set of cells on the same line from left to right, and a column is made up of a line of cells going from top to bottom.

3. What does <tr> stand for?
a) Table rearrangement
b) Table row
c) Table retrieve
d) Table root
View Answer

Answer: b
Explanation: You create a table in XHTML using the < table > element. Inside the < table > element, the table is written out row by row. A row is contained inside a < tr > element, which stands for table row.
advertisement
advertisement

4. What does <td> stand for?
a) Table directory
b) Table direct row
c) Table database
d) Table data
View Answer

Answer: d
Explanation: While a row is contained inside a < tr > element, each cell is then written inside the row element using a < td > element which stands for table data. If you are looking at a web page and want to know whether that page is using a table to control how the data is laid out, you can always look at the source for that page.

5. How does indenting the code for a table be helpful?
a) One tag in a table can prevent the entire table from being displayed properly
b) It helps in providing the updated data regularly
c) No, indenting the code can increase the complexity of the table
d) Indenting helps in better indexing
View Answer

Answer: a
Explanation: Many web page authors find it particularly helpful to indent the code for a table because leaving off just one tag in a table can prevent the entire table from being displayed properly. Indenting the code makes it easier to keep track of the opening and closing of each element.

6. How are <td> and <th> used in a table?
a) Each cell must be represented by either a <td> or a <th> element
b) Only represented by <td> when the table data is present
c) Only represented by <th> when the header is present
d) <td> and <th> can be ignored in respective exceptional cases
View Answer

Answer: a
Explanation: Every cell must be represented by either a < td > or a < th > element for the table to display correctly, even if there is no data in that cell. If a row or column should contain a heading, a < th > element should be used in place of the < td > element for the cells that contain a heading.

7. You cannot have an opening tag for an element inside a table cell and a closing tag outside that cell, or vice versa?
a) True
b) False
View Answer

Answer: a
Explanation: The only constraint on placing markup inside a table is that it must nest within the table cell element (be that a < td > or a < th > element). When creating tables, many people do not actually bother with the < th > element and instead use the < td > element for every cell, including headers.
advertisement

8. The <table> element can carry which attribute of the following?
a) All the deprecated attributes except dir
b) All the deprecated attributes
c) All the universal attributes except summary attribute
d) Basic event attributes for scripting
View Answer

Answer: a
Explanation: The <table> element can contain all the universal attributes. The < table > element can carry the following deprecated attributes. Even though they are deprecated, you will still see many of them in use today: align bgcolor border cellpadding cellspacing dir frame rules summary width.

9. What does rowspawn attribute tell about?
a) Specifies the number of rows a cell should span
b) Specifies the number of rows a cell already spanned
c) Specifies the number of rows a cell has no data/empty
d) Specifies/Identifies a duplicate cell
View Answer

Answer: a
Explanation: The syntax for rowspan is <td rowspan=”number”>. It indicates the number of rows a cell should span in a table. Only Firefox and Opera12 browsers support rowspan.
advertisement

10. Which statement is true about tables?
a) Tables can be used as layout
b) Tables are only used for Data Base Management purposes
c) Tables cannot be used as layout
d) Tables are written column by column
View Answer

Answer: c
Explanation: Table format is not an option for layout. Moreover, for visually impaired users layout tables reduce the accessibility. And tables are written row by row more often for ease of keep a track.

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.