How do you add zebra-striping to a table using Bootstrap?
Experience Level: Junior
Tags: Bootstrap 4
Answer
In order to create a table with zebra-striping, use standard html tags <table>
, <tr>
, <th>
and <td>
. Then add a class table table-striped
to the <table>
tag.
<table class="table table-striped">
<tr>
<th>ID</th>
<th>Name</th>
</tr>
<tr>
<td>11</td>
<td>Peter</td>
</tr>
<tr>
<td>12</td>
<td>Jane</td>
</tr>
</table>
Related Bootstrap job interview questions
How do you make a bordered table using Bootstrap?
Bootstrap 4 JuniorHow do you add zebra-striping and dark style to a table using Bootstrap?
Bootstrap 4 JuniorHow do you style table header to be either light or dark using Bootstrap?
Bootstrap 4 JuniorHow do you create a table with dark style using Bootstrap?
Bootstrap 4 JuniorHow do you style a table using Bootstrap?
Bootstrap 4 Junior