title: Primefaces : How to group a datatable's header columns only?
body: <p>I'm using a Primefaces "Datatable" with a "Subtable".
  I've got some header columns with two row. <br/>
  In the first row, I've got 5 header columns. In the second row, I've got 8 header columns.<br/>
  On the first level columns of my datatable I want to display "Item"s informations in five columns.<br/>
  On the second level and when I display the selected item's child, I want to display the item's status informations (in 8 columns).<br/></p>
  
  <p>The status informations are contained in a subtable.<br/>
  I wanted to packed some columns of my header second row, under columns of my header first row.
  To make it possible, I've referenced on the first row column of the header, the attribute "colspan" with the value "3" and on another column with the value "2".<br/></p>
  
  <p>The problem is it also packs my data value columns of my first level rows. This means I have 8 columns to fill instead of 5 and they are packed. I just want to have 5 columns for my first level and 8 for my second level (status informations).<br/></p>
  
  <p>Is is possible to only add colspan on the header columns and not in the body ?</p>
  
  <p>Here is a sample of my code :</p>
  
  <pre class="lang-xhtml prettyprint-override"><code>        &lt;p:columnGroup type="header"&gt;
              &lt;p:row&gt;
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column headerText="#{bundle.form_name}" filterBy="#{item.name}"
                      sortBy="#{item.name}" colspan="3"&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column headerText="#{bundle.form_designation}"
                      style="width:140px;" filterBy="#{item.designation}"
                      sortBy="#{item.designation}" colspan="2"&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column headerText="#{bundle.form_status}"
                      filterBy="#{item.status}"
                      filterOptions="#{itemStatusListBean.options}"&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column headerText="#{bundle.form_date}"
                      filterBy="#{item.statusDate}" sortBy="#{item.statusDate}"&gt;
                  &lt;/p:column&gt;
              &lt;/p:row&gt;
  
              &lt;p:row&gt;
                  &lt;p:column /&gt;
                  &lt;p:column headerText="Status" style="width:25px;" /&gt;
                  &lt;p:column headerText="Type" style="width:25px;" /&gt;
                  &lt;p:column headerText="Marché" style="width:25px;" /&gt;
                  &lt;p:column headerText="Groupe" /&gt;
                  &lt;p:column headerText="Produit" /&gt;
                  &lt;p:column headerText="Désignation Produit" /&gt;
                  &lt;p:column headerText="EAN" /&gt;
              &lt;/p:row&gt;
          &lt;/p:columnGroup&gt;
  
          &lt;p:column style="width:4%"&gt;
              &lt;p:rowToggler&gt;
              &lt;/p:rowToggler&gt;
          &lt;/p:column&gt;
  
          &lt;p:column&gt;
              &lt;h:outputText value="#{item.name}" /&gt;
          &lt;/p:column&gt;
  
          &lt;p:column&gt;
              &lt;h:outputText value="#{item.designation}" /&gt;
          &lt;/p:column&gt;
  
          &lt;p:column&gt;
              &lt;h:outputText value="#{item.status.label}" /&gt;
          &lt;/p:column&gt;
  
          &lt;p:column&gt;
              &lt;h:outputText value="#{item.statusDate}"&gt;
                  &lt;f:convertDateTime pattern="dd/MM/yyyy" timeZone="Europe/Paris" /&gt;
              &lt;/h:outputText&gt;
          &lt;/p:column&gt;
  
          &lt;p:rowExpansion&gt;
              &lt;p:subTable var="status" value="#{item.status}"&gt;
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
  
                  &lt;p:column&gt;
                  &lt;/p:column&gt;
              &lt;/p:subTable&gt;
          &lt;/p:rowExpansion&gt;
      &lt;/p:dataTable&gt;
  </code></pre>