Style First child TD of a table class - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Style First child TD of a table class

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">
.pretty>*>tr>td:first-child {
   background-color:Chartreuse;
}
</style> <!-- w w w.j  a v a 2  s . c o  m-->
 </head> 
 <body> 
  <table id="logtable" class="pretty"> 
   <thead> 
    <tr> 
     <th>Lore</th> 
     <th>Lore</th> 
     <th>Lo</th> 
     <th>Lorem i</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td> 
      <table> 
       <tbody> 
        <tr> 
         <td>Lorem</td> 
         <td>Lorem</td> 
        </tr> 
       </tbody> 
      </table> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials