<colgroup>

Description

This <colgroup> element groups table columns together and allows the grouped columns to share properties and style settings.

Example


<html>
<body>
     <table>
          <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><!--from w w w  .j ava2s.  c  o  m-->
</html>

Click to view the demo

The code above generates the following result.

colgroup




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference