Select table cell with :nth-child(2) - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Select table cell with :nth-child(2)

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:nth-child(2) td:nth-child(2) {
   border: 1px solid #000;
}


      </style> 
 </head> <!--from   w ww . j ava2s. co m-->
 <body> 
  <table border="0"> 
   <tbody> 
    <tr> 
     <td>A1</td> 
     <td>B1</td> 
     <td>C1</td> 
    </tr> 
    <tr> 
     <td>A2</td> 
     <td>B2</td> 
     <td>C2</td> 
    </tr> 
    <tr> 
     <td>A3</td> 
     <td>B3</td> 
     <td>C3</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials