The <table> tag is used to create a table in HTML.
Click to reveal answer
beginner
What tags define rows and cells inside a table?
Rows are defined with <tr> tags. Inside rows, header cells use <th> and regular cells use <td>.
Click to reveal answer
intermediate
What is the purpose of the <thead>, <tbody>, and <tfoot> tags?
They group parts of a table: <thead> for header rows, <tbody> for body rows, and <tfoot> for footer rows. This helps organize and style tables.
Click to reveal answer
beginner
How do you make a table header cell different from a regular cell?
Use <th> for header cells. They are bold and centered by default, helping users understand the table's columns or rows.
Click to reveal answer
intermediate
Why should tables use semantic tags like <th> and <caption>?
Semantic tags improve accessibility. Screen readers can better describe the table, and browsers can style it properly. <caption> gives a title to the table.
Click to reveal answer
Which tag starts a new row in an HTML table?
A<tr>
B<td>
C<th>
D<table>
✗ Incorrect
The <tr> tag defines a table row.
Which tag is used for a header cell in a table?
A<td>
B<th>
C<tr>
D<thead>
✗ Incorrect
The <th> tag creates a header cell, which is bold and centered by default.
What tag groups the main content rows of a table?
A<caption>
B<tfoot>
C<thead>
D<tbody>
✗ Incorrect
<tbody> groups the body rows of a table.
Which tag provides a title or description for a table?
A<caption>
B<title>
C<header>
D<summary>
✗ Incorrect
The <caption> tag adds a title or description to a table.
Why is it important to use semantic tags in tables?
ATo make tables load faster
BTo reduce file size
CTo improve accessibility and styling
DTo hide table borders
✗ Incorrect
Semantic tags help screen readers and browsers understand and style tables better.
Explain the basic structure of an HTML table and the purpose of its main tags.
Think about how rows and cells are organized inside a table.
You got /5 concepts.
Describe why using semantic tags like
and
is important for tables.
Consider how people with disabilities or browsers benefit.
You got /4 concepts.
Practice
(1/5)
1. Which HTML tag is used to create a row inside a table?
easy
A. <tr>
B. <td>
C. <th>
D. <table>
Solution
Step 1: Understand table row structure
The <tr> tag defines a row in an HTML table.
Step 2: Differentiate row from cells
<td> and <th> define cells, not rows.
Final Answer:
<tr> -> Option A
Quick Check:
Row tag = <tr> [OK]
Hint: Rows use <tr>, cells use <td> or <th> [OK]
Common Mistakes:
Confusing <tr> with <td>
Using <th> for rows
Using <table> for rows
2. Which is the correct way to start a table header section in HTML?
easy
A. <thead>
B. <tbody>
C. <tfoot>
D. <th>
Solution
Step 1: Identify header section tag
The <thead> tag defines the header section of a table.
Step 2: Differentiate from body and footer
<tbody> is for body rows, <tfoot> for footer, and <th> is a cell tag.
Final Answer:
<thead> -> Option A
Quick Check:
Header section = <thead> [OK]
Hint: Table header section starts with <thead> [OK]
The second row cells <td>Book</td><td>$10</td> are not wrapped inside a <tr> tag, which is required.
Step 2: Validate table syntax
Each row must be inside <tr>. Missing it causes invalid structure.
Final Answer:
Missing <tr> tags around second row cells -> Option C
Quick Check:
Rows need <tr> tags [OK]
Hint: Every row's cells must be inside <tr> [OK]
Common Mistakes:
Omitting <tr> tags
Thinking <td> can be direct child of <table>
Confusing <th> and <td> usage
5. You want to create a table with a caption, a header row, a body with two rows, and a footer row. Which is the correct structure?
hard
A. <table><caption>Title</caption><thead><tr><td>H1</td></tr></thead><tbody><tr><td>B1</td></tr><tr><td>B2</td></tr></tbody><tfoot><tr><td>F1</td></tr></tfoot></table>
B. <table><thead><caption>Title</caption><tr><th>H1</th></tr></thead><tbody><tr><td>B1</td></tr><tr><td>B2</td></tr></tbody><tfoot><tr><td>F1</td></tr></tfoot></table>
C. <table><caption>Title</caption><tbody><tr><th>H1</th></tr><tr><td>B1</td></tr><tr><td>B2</td></tr></tbody><tfoot><tr><td>F1</td></tr></tfoot></table>
D. <table><caption>Title</caption><thead><tr><th>H1</th></tr></thead><tbody><tr><td>B1</td></tr><tr><td>B2</td></tr></tbody><tfoot><tr><td>F1</td></tr></tfoot></table>
Solution
Step 1: Confirm caption placement
The <caption> tag must be directly inside <table>, before <thead>.
Step 2: Check header, body, and footer tags
<thead> contains header row with <th>, <tbody> has two data rows, and <tfoot> has footer row.
Step 3: Validate cell tags in header
Header cells use <th>, not <td>.
Final Answer:
Correct structure: caption first, thead with th, tbody with two rows, tfoot -> Option D
Quick Check:
Caption + thead + tbody + tfoot correct order [OK]
Hint: Caption first, then thead, tbody, tfoot with proper cells [OK]
Common Mistakes:
Placing caption inside thead
Using <td> in header
Omitting tbody
Wrong tag order
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.