Add two top borders to a table row with CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Row

Description

Add two top borders to a table row with CSS

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">
table {<!--   w  ww  . ja va2 s  .  co m-->
   margin:0 auto;
   border-collapse:separate;
}

thead {
   background:Chartreuse;
}

th {
   font-weight:bold;
}

tbody tr:last-child td {
   border-bottom:2px solid yellow;
}

tfoot td {
   border-top:2px solid blue;
}
</style> 
 </head> 
 <body> 
  <table> 
   <thead> 
    <tr> 
     <th>Greeting</th> 
     <th>Lang</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td>Hello!</td> 
     <td>EN</td> 
    </tr> 
    <tr> 
     <td>Bonjour!</td> 
     <td>FR</td> 
    </tr> 
   </tbody> 
   <tfoot> 
    <tr> 
     <td>Total two greetings</td> 
     <td>:-)</td> 
    </tr> 
   </tfoot> 
  </table>  
 </body>
</html>

Related Tutorials