Styling a table in html - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table

Description

Styling a table in html

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">
#datatable<!--from  ww w  .j av  a  2s . c  o m-->
 {
   border-collapse:collapse;
}

#datatable tr:first-child td {
   border-bottom:2px solid Chartreuse;
}

#datatable tr td {
   border-bottom:2px solid yellow;
}
</style> 
 </head> 
 <body> 
  <table id="datatable"> 
   <tbody> 
    <tr> 
     <td> <strong>Lore</strong> </td> 
     <td>&nbsp;</td> 
     <td> <strong>Lor</strong> </td> 
    </tr> 
    <tr> 
     <td> <strong>Lore</strong> </td> 
     <td>&nbsp;</td> 
     <td> <strong>Lor</strong> </td> 
    </tr> 
    <tr> 
     <td> <strong>Lore</strong> </td> 
     <td>&nbsp;</td> 
     <td> <strong>Lor</strong> </td> 
    </tr> 
    <tr> 
     <td> <strong>Lore</strong> </td> 
     <td>&nbsp;</td> 
     <td> <strong>Lor</strong> </td> 
    </tr> 
    <tr> 
     <td> <strong>Lore</strong> </td> 
     <td>&nbsp;</td> 
     <td> <strong>Lor</strong> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials