ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 4 Responsive Table
Source Code
<!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content=""> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" /> <title>Bootstrap 4 Responsive Table</title> </head> <body> <h1 class="pl-2 mt-2">Bootstrap 4 Responsive Table</h1> <p class="text-center"> In this example, you will learn how to create a Bootstrap 4 responsive table. Wrap the table inside the external container and assign the .table-responsive class. </p> <div class="table-responsive table-responsive-sm container mt-5"> <table class="table"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Work</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Smith</td> <td>Jane</td> <td>Web Designer</td> </tr> <tr> <td>2</td> <td>John</td> <td>Doe</td> <td>Graphics Designer</td> </tr> <tr> <td>3</td> <td>Andre</td> <td>Ren</td> <td>Developer</td> </tr> </tbody> </table> </div> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js"></script> </body> </html>
Output :
Running