select the first TD elements in a Row - HTML CSS CSS

HTML CSS examples for CSS:Selector

Description

select the first TD elements in a 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">
.mytable tr td:first-child {
   color:Chartreuse;
}
</style> <!--  ww  w .ja  va2  s .  c  om-->
 </head> 
 <body> 
  <table class="mytable"> 
   <tbody> 
    <tr> 
     <td>Lorem ipsum </td> 
     <!--Change color here--> 
     <td>Lorem ipsum </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum</td> 
     <!--Change color here--> 
     <td>Lorem ipsum dol</td> 
    </tr> 
    <tr> 
     <td>Lorem ips</td> 
     <!--Change color here--> 
     <td>Lorem ipsum d</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials