change Row Color when Hovering over a Cell in that Row - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

change Row Color when Hovering over a Cell in that Row

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

tr.hover > td:hover
{
   background-color: red;
}
td.hover:hover { background-color: #00dd00; }


      </style> 
 </head> <!--from   w w w .j av  a2 s.c o m-->
 <body> 
  <table> 
   <tbody> 
    <tr class="hover"> 
     <td>abc abc abc abc abc</td> 
     <td>sql sql sql sql sql sql sql</td> 
    </tr> 
    <tr class="hover"> 
     <td>asdf asdf asf asdf asdf asdf </td> 
     <td>test test test test test test</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials