title: Primefaces Group Table Set Column Width Manually
body: <p>I am using Primefaces 5 and with a Group data table with more than 150 columns. I am trying to set each column width manually. I tried the threads here, but still primefaces is auto adjusting my column widths to show all columns in one screen without any horizontal scrolling. I am looking for one place to set the column width in px or %. 
  I am not sure how to approach with Group Heading.</p>
  
  <p>I tried so far:</p>
  
  <pre><code>resizableColumns="true" style="table-layout: fixed"
  Set style="width:auto" and 
  </code></pre>
  
  <p>set in css:</p>
  
  <pre><code>.repoTab.ui-datatable table { width: auto !important; }
  </code></pre>
  
  <p>My xhtml here: </p>
  
  <pre><code>&lt;h:form&gt;
  &lt;p:dataTable id="userTable" value="#{userDAO.data}" var="ub"
      binding="#{userBean.dataTable}" paginator="true" rows="500"
      resizableColumns="true" style="table-layout: fixed"&gt;
      &lt;f:facet name="header"&gt;
          &lt;p:toolbar&gt;
              &lt;!-- Header Codes Here --&gt;
          &lt;/p:toolbar&gt;
      &lt;/f:facet&gt;
      &lt;p:columnGroup type="header"&gt;
  
          &lt;p:row&gt;
              &lt;p:column colspan="3" headerText="Application" style="width:auto" /&gt;
              &lt;!-- &lt;p:column colspan="6" headerText="Primary" width="100%" /&gt; --&gt;
          &lt;/p:row&gt;
          &lt;p:row&gt;
              &lt;!-- ************ Application ************* --&gt;
              &lt;p:column colspan="3" headerText="Key" style="width:auto" /&gt;
              &lt;!-- ************ Primary ************* --&gt;
          &lt;/p:row&gt;
          &lt;p:row&gt;
              &lt;!-- ************ Appl Key ************* --&gt;
              &lt;p:column headerText="Id" width="50" /&gt;
              &lt;p:column headerText="F Name" width="150" /&gt;
              &lt;p:column headerText="L Name" width="150" /&gt;
  
          &lt;/p:row&gt;
      &lt;/p:columnGroup&gt;
  
      &lt;p:column headerText="Id" width="50"&gt;
          &lt;h:outputText value="#{userBean.dataTable.rowIndex+1}" /&gt;
      &lt;/p:column&gt;
      &lt;p:column headerText="First Name"&gt;
          &lt;h:outputText value="#{ub.firstName}" /&gt;
      &lt;/p:column&gt;
      &lt;p:column headerText="Last Name"&gt;
          &lt;h:outputText value="#{ub.lastName}" /&gt;
      &lt;/p:column&gt; --&gt;         
    &lt;/p:dataTable&gt;
  &lt;/h:form&gt;
  &lt;/html&gt;
  </code></pre>