Edit This Code:
See Result »
<!DOCTYPE html> <html> <title>W3.CSS</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../lib/w3.css"> <body class="w3-container"> <h2>Hoverable Table</h2> <p>If you want a specific hover color, add any of the w3-hover-classes to each tr element:</p> <table class="w3-table w3-striped w3-bordered w3-border"> <thead> <tr class="w3-light-grey w3-hover-red"> <th>First Name</th> <th>Last Name</th> <th>Points</th> </tr> </thead> <tr class="w3-hover-green"> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr class="w3-hover-blue"> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> <tr class="w3-hover-black"> <td>Adam</td> <td>Johnson</td> <td>67</td> </tr> </table> </body> </html>
Result: