'colgroup' Example : table colgroup « Tags « HTML / CSS






'colgroup' Example

   
    
<html>
<head>
<title>colgroup element example</title>
</head>
<body>
   <table width="500" border="8" cellspacing="5" cellpadding="5" align="center">
      <colgroup span="2" style="color:blue;"></colgroup>
      <colgroup style="color:red;"></colgroup>
      <tr><td>col: 1, group: 1</td>
          <td>col: 2, group: 1</td>
          <td>col: 3, group: 2</td></tr>
      <tr><td>col: 1, group: 1</td>
          <td>col: 2, group: 1</td>
          <td>col: 3, group: 2</td></tr>
      <tr><td>col: 1, group: 1</td>
          <td>col: 2, group: 1</td>
          <td>col: 3, group: 2</td></tr>
   </table>
</body>
</html>
           
      
        
    
    
  








Related examples in the same category

1.colgroup span="10"
2.Using colgroup to group columns
3.'span' sets the number of columns in a group
4.colgroup and col tags are used to format entire columns
5.Column Groups
6.Table with column group