0
0
Bootsrapmarkup~20 mins

Small and compact 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 does this Bootstrap table look like?
Look at this Bootstrap table code. What visual style will it produce in the browser?
Bootsrap
<table class="table table-sm">
  <thead>
    <tr>
      <th>Name</th>
      <th>Age</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Alice</td>
      <td>30</td>
    </tr>
    <tr>
      <td>Bob</td>
      <td>25</td>
    </tr>
  </tbody>
</table>
AA small, compact table with reduced padding in cells.
BA table with striped rows alternating colors.
CA table with borders around every cell.
DA large table with extra padding in cells and big text.
Attempts:
2 left
💡 Hint
The class 'table-sm' in Bootstrap makes tables smaller by reducing cell padding.
selector
intermediate
1:30remaining
Which Bootstrap class makes a table compact?
You want to make your Bootstrap table smaller with less space inside cells. Which class should you add?
Atable-sm
Btable-hover
Ctable-striped
Dtable-bordered
Attempts:
2 left
💡 Hint
Look for the class that changes padding size.
🧠 Conceptual
advanced
1:30remaining
Why use small and compact tables in web design?
What is the main benefit of using small and compact tables in a webpage layout?
AThey make tables responsive by stacking rows on small screens.
BThey add colorful borders to make tables more attractive.
CThey automatically sort table data alphabetically.
DThey improve readability by reducing white space and fitting more data on screen.
Attempts:
2 left
💡 Hint
Think about how space and data display relate.
📝 Syntax
advanced
2:00remaining
Identify the error in this Bootstrap table code for compact style
This code tries to create a small Bootstrap table but has a mistake. What is the error?
Bootsrap
<table class="table small">
  <thead>
    <tr><th>Item</th><th>Price</th></tr>
  </thead>
  <tbody>
    <tr><td>Pen</td><td>$1</td></tr>
  </tbody>
</table>
AThe <thead> tag cannot be used with Bootstrap tables.
BThe table tag is missing the closing </table> tag.
CThe class 'small' is not a Bootstrap table class for compact tables.
DThe <tbody> tag should come before <thead>.
Attempts:
2 left
💡 Hint
Bootstrap uses a specific class name for small tables.
accessibility
expert
2:30remaining
How to make a small Bootstrap table accessible?
You have a small Bootstrap table. What is the best way to improve its accessibility for screen readers?
Bootsrap
<table class="table table-sm">
  <caption>Product quantities</caption>
  <thead>
    <tr><th scope="col">Product</th><th scope="col">Qty</th></tr>
  </thead>
  <tbody>
    <tr><td>Notebook</td><td>5</td></tr>
  </tbody>
</table>
ARemove the <thead> section to simplify the table.
BAdd <caption> describing the table content.
CUse only <div> elements instead of <table> for better accessibility.
DAdd inline styles to increase font size.
Attempts:
2 left
💡 Hint
Think about how screen readers understand tables.