Challenge - 5 Problems
Cell Merging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual result of this table with merged cells?
Look at this HTML table code. What will you see in the browser?
HTML
<table border="1"> <tr> <td rowspan="2">A</td> <td>B</td> </tr> <tr> <td>C</td> </tr> </table>
Attempts:
2 left
💡 Hint
Remember, rowspan merges cells vertically.
✗ Incorrect
The cell with rowspan="2" merges vertically across two rows, so 'A' covers the first column in both rows. 'B' and 'C' appear in the second column stacked vertically.
❓ rendering
intermediate2:00remaining
What does colspan="3" do in this table?
Check this table code. What will the first row look like in the browser?
HTML
<table border="1"> <tr> <td colspan="3">Header</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </table>
Attempts:
2 left
💡 Hint
colspan merges cells horizontally.
✗ Incorrect
The cell with colspan="3" stretches across three columns, so the entire first row is one big cell labeled 'Header'.
📝 Syntax
advanced2:00remaining
What error does this table code cause?
This HTML snippet tries to merge cells but has a mistake. What error or problem will happen?
HTML
<table border="1"> <tr> <td colspan="2">X</td> <td>Y</td> </tr> <tr> <td>A</td> <td>B</td> </tr> </table>
Attempts:
2 left
💡 Hint
Count columns in each row after merging.
✗ Incorrect
The first row has 3 columns total (colspan=2 plus one cell). The second row has only 2 cells, so the table layout is uneven and may cause rendering issues.
❓ accessibility
advanced2:00remaining
Which attribute improves accessibility for merged table cells?
When merging cells in a table, which attribute helps screen readers understand the table structure better?
Attempts:
2 left
💡 Hint
This attribute defines the cell's role as header for rows or columns.
✗ Incorrect
The 'scope' attribute on elements tells screen readers if the header applies to a row, column, or group, improving accessibility especially with merged cells.
❓ selector
expert2:00remaining
Which CSS selector targets all cells merged horizontally with colspan?
You want to style all table cells that have a colspan attribute. Which CSS selector works?
Attempts:
2 left
💡 Hint
Attribute selectors use square brackets.
✗ Incorrect
The selector td[colspan] selects all elements with a colspan attribute, regardless of its value.