Challenge - 5 Problems
Table Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What color will the table row have?
Given the following Bootstrap table code, what color will the second row have when rendered in a browser?
Bootsrap
<table class="table"> <tbody> <tr class="table-primary"> <td>Row 1</td> </tr> <tr class="table-success"> <td>Row 2</td> </tr> </tbody> </table>
Attempts:
2 left
💡 Hint
Bootstrap uses specific classes like table-success for green backgrounds.
✗ Incorrect
The class 'table-success' applies a green background color to the table row in Bootstrap.
❓ selector
intermediate1:30remaining
Which class applies a red background to a table row?
In Bootstrap, which class should you add to a table row to make its background red?
Attempts:
2 left
💡 Hint
Think about the meaning of 'danger' in color coding.
✗ Incorrect
The 'table-danger' class in Bootstrap applies a red background to table rows or cells.
🧠 Conceptual
advanced1:30remaining
What is the effect of the class 'table-striped' on a Bootstrap table?
What visual effect does adding the class 'table-striped' have on a Bootstrap table?
Attempts:
2 left
💡 Hint
Striped means lines or bands of color.
✗ Incorrect
The 'table-striped' class adds alternating background colors to odd table rows for better readability.
❓ accessibility
advanced2:00remaining
How to improve accessibility for colored table rows?
When using Bootstrap table color variants like 'table-success' or 'table-danger', what should you do to ensure good accessibility?
Attempts:
2 left
💡 Hint
Think about users who might not see colors well.
✗ Incorrect
Good accessibility means colors must have enough contrast and ARIA labels help screen readers understand the meaning.
📝 Syntax
expert2:30remaining
What error occurs with this Bootstrap table class usage?
What happens if you write this HTML code for a Bootstrap table row?
| Row 1 |
Bootsrap
<table class="table"> <tbody> <tr class="table-success table-danger"> <td>Row 1</td> </tr> </tbody> </table>
Attempts:
2 left
💡 Hint
CSS classes applied later or with higher specificity override earlier ones.
✗ Incorrect
When multiple Bootstrap color classes are applied, the last one in the CSS order usually takes precedence, so 'table-danger' (red) overrides 'table-success' (green).