The document is a comprehensive guide on HTML tables, covering elements like `<table>`, `<tr>`, `<td>`, and `<th>`, as well as attributes such as `colspan` and `rowspan`. It includes multiple choice questions, true/false statements, direct questions, and definitions to test understanding of table structure and styling. Additionally, it differentiates between various HTML and CSS properties related to tables.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
7 views12 pages
Chapter 9 Web-Design Questions and Answers
The document is a comprehensive guide on HTML tables, covering elements like `<table>`, `<tr>`, `<td>`, and `<th>`, as well as attributes such as `colspan` and `rowspan`. It includes multiple choice questions, true/false statements, direct questions, and definitions to test understanding of table structure and styling. Additionally, it differentiates between various HTML and CSS properties related to tables.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12
Part 1: Multiple choice
1. Which element is used to create a table in HTML?
a) `<table>` b) `<tr>` c) `<td>` d) `<th>` Answer: a) `<table>`
2. What does the `<tr>` element represent in an HTML
table? a) Table data cell b) Table header cell c) Table row d) Table caption Answer: c) Table row
3. Which element is used to define a table header cell?
a) `<td>` b) `<th>` c) `<tr>` d) `<table>` Answer: b) `<th>`
Prepared by: Mohamet Ismail Bile
4. What attribute is used to merge cells horizontally in a table? a) rowspan b) colspan c) merge d) span Answer: b) colspan
5. Which attribute is used to merge cells vertically in a
table? a) colspan b) rowspan c) merge d) span Answer: b) rowspan
6. What element is used to provide a caption for a table?
a) `<th>` b) `<td>` c) `<caption>` d) `<table>` Answer: c) `<caption>`
7. Which attribute provides a border for a table?
a) border
Prepared by: Mohamet Ismail Bile
b) outline c) frame d) edge Answer: a) border
8. Which CSS property is used to set the space between
table cells? a) border-spacing b) cellpadding c) cellspacing d) margin Answer: a) border-spacing
9. What is the purpose of the `<thead>` element?
a) To define the table header row b) To group header content in a table c) To define the body of a table d) To group footer content in a table Answer: b) To group header content in a table
10. What does the `<tbody>` element represent?
a) Table body rows b) Table head rows c) Table footer rows
Prepared by: Mohamet Ismail Bile
d) Table caption Answer: a) Table body rows
11. What is the function of the `<tfoot>` element?
a) To define the footer of the document b) To group footer content in a table c) To style the table footer d) To summarize the table data Answer: b) To group footer content in a table
12. Which element contains the individual data cells in a
table? a) `<td>` b) `<tr>` c) `<th>` d) `<table>` Answer: a) `<td>`
13. Which CSS property is used to align text within a table
cell? a) align b) text-align c) cell-align d) vertical-align Answer: b) text-align
Prepared by: Mohamet Ismail Bile
14. What does the scope attribute in the `<th>` element specify? a) The visual style of the header cell b) The relationship between header and data cells c) The size of the header cell d) The color of the header cell Answer: b) The relationship between header and data cells
15. Which HTML attribute provides a summary of a table’s
structure and purpose? a) caption b) description c) summary d) details Answer: c) summary
Prepared by: Mohamet Ismail Bile
Part 2: True and false 1. Tables on web pages are used to organize tabular information. - True
2. The `<table>` element contains the entire table.
- True
3. The `<tr>` element contains a table cell.
- False
4. The `<td>` element contains a table row.
- False
5. The `<caption>` element configures a description of the
table. - True
6. Using the `border` attribute with value `1` makes the
table border visible. - True
7. The `<th>` element is used to create a table header
cell. - True
Prepared by: Mohamet Ismail Bile
8. CSS cannot be used to style HTML tables. - False
9. The `colspan` attribute allows a cell to span multiple
columns. - True
10. The `rowspan` attribute allows a cell to span multiple
rows. - True
11. The `<thead>` element is used to group the table
body rows. - False
12. The `<tbody>` element is used to group the table
head rows. - False
13. The `<tfoot>` element is used to group the table
footer rows. - True
14. Using the `<th>` element automatically centers the
content.
Prepared by: Mohamet Ismail Bile
- False
15. The `scope` attribute in tables is used to improve
accessibility. - True
Part 3: Direct questions
1. What HTML tag is used to create a table? - Answer: `<table>`
2. Which tag is used to create a table row?
- Answer: `<tr>`
3. Which tag is used to create a table cell?
- Answer: `<td>`
4. What is the purpose of the `<caption>` tag?
- Answer: To configure a description of the table.
5. Which tag is used for a table header cell?
- Answer: `<th>`
6. What attribute is used to merge two or more columns in
a table? - Answer: `colspan`
Prepared by: Mohamet Ismail Bile
7. What attribute is used to merge two or more rows in a table? - Answer: `rowspan`
8. Which attribute is used to add a border to a table?
- Answer: `border`
9. What are the three main table sections in HTML?
- Answer: `<thead>`, `<tbody>`, `<tfoot>`
10. Which CSS property is used to collapse table borders?
- Answer: `border-collapse`
Part 4: Definition and differentiation
Definition Questions:
1. Define the `<table>` element.
- answer: The `<table>` element is used to create a table in HTML for organizing data into rows and columns.
2. What is the `<tr>` element used for?
Prepared by: Mohamet Ismail Bile
- answer: The `<tr>` element is used to define a row within an HTML table.
3. Explain the purpose of the `<td>` element.
- answer: The `<td>` element is used to define a standard data cell within a table row.
4. What does the `<caption>` element do in a table?
- answer: The `<caption>` element provides a title or description for the table, which is displayed above the table by default.
5. What is the `<th>` element?
- answer: The `<th>` element defines a header cell in an HTML table, which is typically bold and centered.
6. Define the `border-collapse` CSS property.
- answer: The `border-collapse` CSS property specifies whether the table borders should be collapsed into a single border or separated.
Differentiate Questions:
1. Differentiate between `<td>` and `<th>` elements.
Prepared by: Mohamet Ismail Bile
- answer: `<td>` is used for standard data cells, while `<th>` is used for header cells, which are bold and centered by default.
2. Differentiate between `colspan` and `rowspan`
attributes. - answer: `colspan` allows a cell to span multiple columns, while `rowspan` allows a cell to span multiple rows.
3. Differentiate between `<thead>` and `<tbody>`.
- answer: `<thead>` groups the header content in a table, while `<tbody>` groups the body content, which contains the main data rows.
4. Differentiate between `border-spacing` and `border-
collapse` CSS properties. - answer: `border-spacing` sets the distance between the borders of adjacent cells, while `border-collapse` determines whether table borders are separated or collapsed.
5. Differentiate between `<caption>` and `summary`
attribute in a table. - answer: `<caption>` provides a visible title or description for the table, while the `summary` attribute
Prepared by: Mohamet Ismail Bile
(deprecated in HTML5) provided a textual description of the table’s structure for accessibility.
6. Differentiate between `align` and `valign` attributes in
a table cell. - answer: `align` sets the horizontal alignment of the cell content (left, center, right), while `valign` sets the vertical alignment (top, middle, bottom).