Bootstrap table row hover

Twitter BootstrapTwitter Bootstrap-3HoverRowCss Tables

Twitter Bootstrap Problem Overview


How do I make the background change of a table row in Bootstrap 3 on hover. The table class I am using right now is table table-striped. I tried to add a extra class to the <tr> tags within the table and made the css like this .table-row:hover{background:black;}. Now only the non-striped rows are working. Isn't there a class in bootstrap that will allow me to easily implement this? Or should I use JQuery to fix this? I really cannot figure this one out by myself.

Twitter Bootstrap Solutions


Solution 1 - Twitter Bootstrap

You need to add the table-hover class to the <table/> element. Like this:

<table class="table table-striped table-hover">
    <tbody>
       <tr>
           <td>Col 1</td>
           <td>Col 2 </td>
       </tr>
    </tbody>
</table>

Source: Documentation

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser6827View Question on Stackoverflow
Solution 1 - Twitter BootstrapjraedeView Answer on Stackoverflow