The HTML tables are the most utilized component in the web application. Essentially, the HTML table is utilized to introduce the information in line and sections on the site page. It is generally desirable to make tables responsive for a better client experience. On the off chance that your web application utilizes Bootstrap, you can undoubtedly construct a table plan in a moment. Additionally, you can make the Bootstrap table responsive by adding a solitary class.
In this instructional exercise, we will tell you the best way to make a responsive table with Bootstrap. Utilizing Bootstrap you can improve the presence of the HTML table in a simple manner. The Bootstrap responsive table is the ideal decision for information posting.
The accompanying various kinds of table models cause you to make even tables with fundamental styling utilizing Bootstrap.
The Bootstrap and jQuery library should be incorporated to utilize the Bootstrap system.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Basic Bootstrap Responsive Table
Use table class to add basic style to the HTML table. The table-responsive class makes the table responsive.
<table class="table table-responsive"> <thead> <tr> <th>First Name</th> <th>Last Name</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> </tr> <tr> <td>Smith</td> <td>Thomas</td> <td>smith@example.com</td> </tr> <tr> <td>Merry</td> <td>Jim</td> <td>merry@example.com</td> </tr> </tbody> </table>
Striped Bootstrap Responsive Table
Use the table-striped class to add stripes to the HTML table.
<table class="table table-responsive table-striped"> <thead> <tr> <th>First Name</th> <th>Last Name</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> </tr> <tr> <td>Smith</td> <td>Thomas</td> <td>smith@example.com</td> </tr> <tr> <td>Merry</td> <td>Jim</td> <td>merry@example.com</td> </tr> </tbody> </table>
Bordered Bootstrap Responsive Table
Use a table-bordered class to add borders to the HTML table.
<table class="table table-responsive table-bordered"> <thead> <tr> <th>First Name</th> <th>Last Name</th> <th>Email</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Doe</td> <td>john@example.com</td> </tr> <tr> <td>Smith</td> <td>Thomas</td> <td>smith@example.com</td> </tr> <tr> <td>Merry</td> <td>Jim</td> <td>merry@example.com</td> </tr> </tbody> </table>