0
0
Bootsrapmarkup~20 mins

Striped and hover tables in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Table Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2: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>
ATable header cells become bold and underlined.
BRows alternate background colors, making every other row shaded differently.
CRows highlight with a color when hovered by the mouse pointer.
DTable borders become thicker and darker.
Attempts:
2 left
💡 Hint
Think about how to make reading rows easier by changing backgrounds.
rendering
intermediate
2: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>
ATable header cells become clickable buttons.
BRows have alternating background colors by default.
CRows change background color when hovered by the mouse pointer.
DTable rows become bold when clicked.
Attempts:
2 left
💡 Hint
Hover means moving the mouse over something.
selector
advanced
2: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?
A.table-hover tbody tr:hover
B.table-hover tr:hover
Ctbody tr:hover
D.table-hover > tr:hover
Attempts:
2 left
💡 Hint
Think about which rows inside the table body get hovered.
layout
advanced
2: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>
ARows alternate background colors, but hover effect changes text color instead of background.
BOnly the striped effect works; hover effect is ignored.
COnly the hover effect works; striped rows are not visible.
DRows alternate background colors, and the hovered row changes background color on mouse hover.
Attempts:
2 left
💡 Hint
Both classes add different background color effects.
accessibility
expert
3: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>
AAdd <code>role="grid"</code> and <code>aria-rowcount</code> to indicate row count.
BAdd <code>aria-live="polite"</code> to announce row changes dynamically.
CAdd <code>role="presentation"</code> to hide the table from assistive tech.
DAdd <code>role="list"</code> to treat the table as a list.
Attempts:
2 left
💡 Hint
Think about roles that describe tables and their structure.