Adding a right border to the last table header column with th:last-child - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Column

Description

Adding a right border to the last table header column with th:last-child

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">
#data th:last-child {
   border-right:3px solid Chartreuse;
}
</style> <!--from   w  w  w  .  ja va2s  . c o m-->
 </head> 
 <body> 
  <table id="data" class="ui-widget-content"> 
   <thead> 
    <tr> 
     <th>header1</th> 
     <th>header2</th> 
     <th>header3</th> 
     <th>header4</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
    </tr> 
    <tr> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
    </tr> 
    <tr> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
    </tr> 
    <tr> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
    </tr> 
    <tr> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials