Changing the font style of HTML on odd indexed column - HTML CSS CSS Property

HTML CSS examples for CSS Property:font-style

Description

Changing the font style of HTML on odd indexed column

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 td:nth-child(odd) {
   font-weight:bold;
}
</style> <!--from   ww w  . ja v a2s. c  om-->
 </head> 
 <body> 
  <table id="tabla" align="center" cellspacing="15" cellpadding="0"> 
   <tbody> 
    <tr> 
     <td> <input type="button" value="Form View"> </td> 
     <td> <input type="button" value="Table view"> </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolo</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem ipsum dolor</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolo</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem ipsum dolor</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolo</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem ipsum dolor</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolo</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem</td> 
     <td>Lorem ipsum dolor</td> 
     <td>Lorem</td> 
     <td>Lorem i</td> 
     <td>Lorem</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials