colgroup and col tags are used to format entire columns : table colgroup « Tags « HTML / CSS






colgroup and col tags are used to format entire columns

    

<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns = "http://www.w3.org/1999/xhtml">
   <head>
      <title> - Tables</title>
   </head>
   <body>
      <table border = "1">
         <caption>Here is a more complex sample table.</caption>
         <colgroup>
            <col align = "right" span = "1" />
         </colgroup>
         <thead>
            <tr valign = "bottom">
               <th># of Humps</th>
               <th>Indigenous region</th>
               <th>Spits?</th>
               <th>Produces Wool?</th>
            </tr>
         </thead>
         <tbody>
            <tr>
               <th>C</th>
               <td>2</td>
               <td>A</td>
               <td rowspan = "2">L</td>
               <td rowspan = "2">L</td>
            </tr>
            <tr>
               <th>L</th>
               <td>1</td>
               <td>A</td>
            </tr>
         </tbody>
      </table>
   </body>
</html>

   
    
    
  








Related examples in the same category

1.'colgroup' Example
2.colgroup span="10"
3.Using colgroup to group columns
4.'span' sets the number of columns in a group
5.Column Groups
6.Table with column group