HTML MCQs – HTML Tables, Lists, and Semantic Elements

11.) What is the purpose of the <tbody> element in an HTML table?

A) Defines the table footer
B) Defines the table body
C) Defines the table header
D) Defines a table cell

Answer: Option B

Explanation: The <tbody> element is used to define the body of an HTML table, containing the main content of the table rows.

12.) Which HTML element is used to create a list item in an ordered or unordered list?

A) <list>
B) <itom>
C) <li>
D) <ul>

Answer: Option C

Explanation: The <li> element is used to create a list item in both ordered <ol> and unordered <ul> lists in HTML.

13.) What HTML element is used to define the contents of a table cell in an HTML table?

A) <td>
B) <tr>
C) <th>
D) <table>

Answer: Option A

Explanation: The <td> element is used to define the contents of a table cell in an HTML table, representing data cells.

14.) Which HTML element is used to create a sublist within a list item in HTML?

A) <li>
B) <ul>
C) <ol>
D) <sublist>

Answer: Option B

Explanation: The <ul> element is used to create a sublist within a list item <li> in HTML, allowing nested lists.

15.) What is the purpose of the element in an HTML table?

A) Defines a caption for the table
B) Defines table headers
C) Defines table data cells
D) Defines a footer for the table

Answer: Option A

Explanation: The <caption> element is used to define a caption for an HTML table, providing a title or description for the table.

16.) Which HTML element is used to create a table row group in an HTML table?

A) <tr>
B) <thead>
C) <tbody>
D) <tfoot>

Answer: Option C

Explanation: The <tbody> element is used to create a table row group in an HTML table, grouping a set of rows together within the table body.

17.) What is the function of the <tfoot> element in an HTML table?

A) Defines the table header
B) Defines the table body
C) Defines the table footer
D) Defines a table cell

Answer: Option C

Explanation: The <tfoot> element is used to define the footer of an HTML table, typically containing summary or footer information for the table.

18.) Which HTML element is used to create a sublist within an ordered or unordered list item?

A) <ul>
B) <ol>
C) <li>
D) <sublist>

Answer: Option A

Explanation: The <ul> element is used to create a sublist within an ordered <ol> or unordered <ul> list item <li> in HTML.

19.) What is the purpose of the <colgroup> element in an HTML table?

A) Defines a group of table columns
B) Defines a group of table rows
C) Defines the table body
D) Defines a table footer

Answer: Option A

Explanation: The <colgroup> element is used to define a group of table columns in an HTML table, allowing styling and attributes to be applied to multiple columns.

20.) What is the purpose of the element in an HTML table?

A) Defines the table footer
B) Defines the table body
C) Defines the table header
D) Defines a table cell

Answer: Option B

Explanation: The <tbody> element is used to define the body of an HTML table, containing the main content of the table rows.

Leave a Reply

Your email address will not be published. Required fields are marked *