1.

Add a hover effect on table rows in Bootstrap

Answer»

The .table-hover class is used in BOOTSTRAP to add a hover effect on table rows. A GREY background color is VISIBLE when mouse hovers.

The following is an example:

<!DOCTYPE html> <html lang="en"> <head>   <title>Bootstrap Striped 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-hover">     <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>     </tbody>   </table> </div> </body> </html>

The output displays the following table:

On mouse hover over any of the row, a gray background color is visible:



Discussion

No Comment Found