Challenge - 5 Problems
Bootstrap Table Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What visual effect does the
.table-striped class add to a Bootstrap table?Look at a Bootstrap table with the
.table-striped class applied. What will you see when the table is rendered in a browser?Bootsrap
<table class="table table-striped"> <thead> <tr><th>#</th><th>Name</th></tr> </thead> <tbody> <tr><td>1</td><td>Alice</td></tr> <tr><td>2</td><td>Bob</td></tr> <tr><td>3</td><td>Carol</td></tr> </tbody> </table>
Attempts:
2 left
💡 Hint
Think about how to make reading rows easier by changing backgrounds.
✗ Incorrect
The
.table-striped class adds alternating background colors to table rows, improving readability by visually separating rows.❓ rendering
intermediate2:00remaining
What does the
.table-hover class do in a Bootstrap table?Given a Bootstrap table with the
.table-hover class, what visual effect will you see when you move your mouse over the rows?Bootsrap
<table class="table table-hover"> <thead> <tr><th>ID</th><th>City</th></tr> </thead> <tbody> <tr><td>1</td><td>Paris</td></tr> <tr><td>2</td><td>London</td></tr> <tr><td>3</td><td>Tokyo</td></tr> </tbody> </table>
Attempts:
2 left
💡 Hint
Hover means moving the mouse over something.
✗ Incorrect
The
.table-hover class highlights the row background on mouse hover, helping users track which row they are pointing at.❓ selector
advanced2:00remaining
Which CSS selector does Bootstrap use internally to apply the hover effect for
.table-hover?Bootstrap applies a background color on table rows when hovered using a CSS selector. Which selector correctly targets the rows inside a table with
.table-hover?Attempts:
2 left
💡 Hint
Think about which rows inside the table body get hovered.
✗ Incorrect
Bootstrap uses the selector
.table-hover tbody tr:hover to apply hover styles only to rows inside the table body, not headers or footers.❓ layout
advanced2:00remaining
How do
.table-striped and .table-hover classes interact when both are applied to a Bootstrap table?If you add both
.table-striped and .table-hover classes to a Bootstrap table, what will be the combined visual effect?Bootsrap
<table class="table table-striped table-hover"> <thead> <tr><th>#</th><th>Item</th></tr> </thead> <tbody> <tr><td>1</td><td>Pen</td></tr> <tr><td>2</td><td>Notebook</td></tr> <tr><td>3</td><td>Eraser</td></tr> </tbody> </table>
Attempts:
2 left
💡 Hint
Both classes add different background color effects.
✗ Incorrect
When both classes are used, rows have alternating backgrounds, and the hovered row changes background color on mouse hover, combining both effects.
❓ accessibility
expert3:00remaining
Which ARIA role and attribute best improve accessibility for a Bootstrap table with striped and hover effects?
To make a Bootstrap table with
.table-striped and .table-hover accessible for screen readers and keyboard users, which ARIA role and attribute combination is most appropriate?Bootsrap
<table class="table table-striped table-hover" ... > ... </table>
Attempts:
2 left
💡 Hint
Think about roles that describe tables and their structure.
✗ Incorrect
Using
role="grid" helps assistive technologies understand the table as a grid of data, and aria-rowcount informs about the number of rows, improving navigation and context.