Saved Bookmarks
| 1. |
Which class is to be used to create Bordered Table? |
|
Answer» To create a bordered table, use the .table-bordered class. The bordered table will have borders on the sizes of the table and its cells. Here’s how you add a bordered table: <table class="table table-bordered"> … </table>The below example displays how we can create a bordered table: <!DOCTYPE HTML> <html lang="en"> <head> <title>Bootstrap Bordered Table</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <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.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>DATA</h2> <p>The following is the Investor's data:</p> <table class="table table-bordered"> <thead> <tr> <th>COMPANY</th> <th>Investor</th> </tr> </thead> <tbody> <tr> <td>ABC</td> <td>PQ</td> </tr> <tr> <td>GHI</td> <td>VW</td> </tr> <tr> <td>JKL</td> <td>EF</td> </tr> <tr> <td>RST</td> <td>IJ</td> </tr> <tr> <td>MNO</td> <td>KL</td> </tr> <tr> <td>WXA</td> <td>MN</td> </tr> </tbody> </table> </div> </body> </html>The above displays the following bordered table. We have here 7 rows and 2 columns: |
|