Complete the code to make the table responsive using Bootstrap.
<div class="[1]"> <table class="table"> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </tbody> </table> </div>
Bootstrap makes tables responsive by wrapping them in a div with the class table-responsive. This allows horizontal scrolling on small screens.
Complete the code to add striped rows to the responsive table.
<div class="table-responsive"> <table class="table [1]"> <thead> <tr> <th>Item</th> <th>Price</th> </tr> </thead> <tbody> <tr> <td>Apple</td> <td>$1</td> </tr> <tr> <td>Banana</td> <td>$0.5</td> </tr> </tbody> </table> </div>
The table-striped class adds alternating background colors to table rows, making it easier to read.
Fix the error in the code to make the table responsive on small screens.
<div class="table-responsive-[1]"> <table class="table"> <thead> <tr> <th>Name</th> <th>Age</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>30</td> </tr> </tbody> </table> </div>
Bootstrap uses table-responsive-sm to make tables responsive on small devices and smaller. The suffix 'sm' is the correct breakpoint abbreviation.
Fill both blanks to create a responsive, bordered table with hover effect.
<div class="[1]"> <table class="table [2] table-hover"> <thead> <tr> <th>Product</th> <th>Quantity</th> </tr> </thead> <tbody> <tr> <td>Book</td> <td>3</td> </tr> </tbody> </table> </div>
Wrapping the table in a table-responsive div makes it scrollable on small screens. Adding table-bordered adds borders around cells. The table-hover class adds a highlight on row hover.
Fill all three blanks to create a small, responsive, striped table with hover effect.
<div class="[1]"> <table class="table [2] [3]"> <thead> <tr> <th>City</th> <th>Country</th> </tr> </thead> <tbody> <tr> <td>Paris</td> <td>France</td> </tr> </tbody> </table> </div>
The table-responsive class on the div makes the table scrollable on small screens. The table-striped class adds alternating row colors. The table-hover class adds a highlight on hover. The table-sm class makes the table more compact but is not used here.