Add spacing between to colgroups - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Column

Description

Add spacing between to colgroups

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<!-- www.  j  a  v a  2s  . co  m-->
 {
   border-collapse:collapse;
   border:2px solid Chartreuse;
}

#colgrp0
 {
   background-color:yellow;
}

#colgrp1
 {
   background-color:blue;
   border-left:21px solid pink;
}
</style> 
 </head> 
 <body> 
  <table> 
   <colgroup id="colgrp0"> 
    <col> 
    <col> 
   </colgroup> 
   <colgroup id="colgrp1"> 
    <col> 
    <col> 
   </colgroup> 
   <thead> 
    <tr> 
     <th>Col A1</th> 
     <th>Col A2</th> 
     <th>Col B1</th> 
     <th>Col B2</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td>A1</td> 
     <td>A2</td> 
     <td>B1</td> 
     <td>B2</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials