Challenge - 5 Problems
Bootstrap Table Styling Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual effect of
.table-striped in Bootstrap?Look at a Bootstrap table with the
.table-striped class applied. What do you see?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>Charlie</td></tr> </tbody> </table>
Attempts:
2 left
💡 Hint
Think about how alternating colors help you read rows easier.
✗ Incorrect
The .table-striped class adds a subtle background color to every other row. This helps users follow rows horizontally without losing track.
❓ selector
intermediate1:30remaining
Which Bootstrap class adds borders to all table cells?
You want every cell in your Bootstrap table to have visible borders. Which class do you add?
Attempts:
2 left
💡 Hint
Borders mean lines around cells.
✗ Incorrect
The .table-bordered class adds borders around all table cells, making the grid lines visible.
🧠 Conceptual
advanced1:30remaining
What does the
.table-hover class do in Bootstrap tables?Consider a Bootstrap table with the
.table-hover class. What happens when you move your mouse over the rows?Attempts:
2 left
💡 Hint
Hover means moving the mouse over something.
✗ Incorrect
The .table-hover class highlights the row under the mouse pointer with a subtle background color, improving readability.
❓ accessibility
advanced1:30remaining
Which attribute improves accessibility for Bootstrap tables?
To help screen readers understand your table, which attribute should you add to the
<table> element?Attempts:
2 left
💡 Hint
Screen readers use roles to identify elements.
✗ Incorrect
Adding role="table" explicitly tells assistive technologies that this element is a table, improving accessibility.
❓ layout
expert2:30remaining
How does
.table-responsive affect Bootstrap tables on small screens?You add
.table-responsive around your table. What happens when viewing on a narrow mobile screen?Bootsrap
<div class="table-responsive"> <table class="table"> <thead> <tr><th>#</th><th>Name</th><th>Age</th><th>City</th></tr> </thead> <tbody> <tr><td>1</td><td>Alice</td><td>30</td><td>New York</td></tr> <tr><td>2</td><td>Bob</td><td>25</td><td>Chicago</td></tr> </tbody> </table> </div>
Attempts:
2 left
💡 Hint
Think about how you can see wide tables on small phones.
✗ Incorrect
The .table-responsive class wraps the table in a container that allows horizontal scrolling on small screens, preserving layout and readability.