style a table with only partly border spacing - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Border

Description

style a table with only partly border spacing

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">
#table1 {<!--   w  w w .  ja  v  a 2s  . c  om-->
   border-collapse:collapse;
}

table {
   border-collapse:separate;
}

th,
td {
   vertical-align:top;
}

thead tr:first-child th {
   border-top:3px solid;
}

thead tr:not(:first-child) th {
   border-top:2px solid;
}

tbody tr:first-child td {
   border-top:2px solid;
}

tbody tr {
   border-top:2px solid;
}
</style> 
 </head> 
 <body> 
  <table id="table1"> 
   <thead> 
    <tr> 
     <th rowspan="2">Lo</th> 
     <th colspan="2">Lo</th> 
    </tr> 
    <tr> 
     <th>Lore</th> 
     <th>Lore</th> 
    </tr> 
   </thead> 
  </table> 
  <table> 
   <tbody> 
    <tr> 
     <td>Lo</td> 
     <td>Lore</td> 
     <td>Lore</td> 
    </tr> 
    <tr> 
     <td>Lo</td> 
     <td>Lore</td> 
     <td>Lore</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials