title: Set p:dataTable p:column width
body: <p>I am trying to set the column widths of my data table. I have looked at this question for an answer <a href="https://stackoverflow.com/questions/7434203/primefaces-3-0-how-to-set-width-of-a-pcolumn-in-a-pdatatable">How to set width of a p:column in a p:dataTable in PrimeFaces 3.0?</a>.</p>
  
  <p>I am however trying to do something a little bit different. I only want the column to be as wide as the widest element it it is displaying. Most of my data is text.</p>
  
  <p>So for example, it should not look like this</p>
  
  <pre>
  -----------------------------
  | This is some text         |
  -----------------------------
  </pre>
  
  <p>It should look like this</p>
  
  <pre>
  ---------------------
  | This is some text |
  ---------------------
  </pre>
  
  <p>If there are multiple rows, the coulmn should be as large as the widest element.</p>