title: Set columnwidth of a table in XWPFTableCell (docx)
body: <p>I'm generating a docx file with apache-poi. In the wordfile, I add tables, whose columns have a width I would like to see fixed.</p>
  
  <p>Currently, I use the technique described here: <a href="http://apache-poi.1045710.n5.nabble.com/Is-there-a-way-to-set-the-width-of-a-column-in-XWPFTableCell-td5711491.html" rel="noreferrer">http://apache-poi.1045710.n5.nabble.com/Is-there-a-way-to-set-the-width-of-a-column-in-XWPFTableCell-td5711491.html</a></p>
  
  <p>Basically, this entails setting </p>
  
  <pre><code>cell.getCTTc().addNewTcPr().addNewTcW().setW(BigInteger.valueOf(cols[j])); 
  </code></pre>
  
  <p>on each cell of that column.</p>
  
  <p>The problem is that while the file opens perfectly in MS Word, open office interprets the values I set to the columnwidth differently. Whereas MS Word apparantly assumes 20-th of a point as units, open office seems to use points instead and therefore all columns are 20 times wider when I open the generated document in OO.</p>
  
  <p>Usually when I see something weird in the generated output, I unpack the docx file, see what the value should be and change my code. But open office does not seem to be able to save to docx, so I can't change the value in OO save it back and see if Word still interprets the document correctly in order to find a cross-application solution.</p>
  
  <p>Any idea how I set the width of the table column so that both OO and MS Wordt interprets it the same?</p>