Yegor,
 Ok, the issue was my environment.  I had MS-Office 2007 installed. Once I 
upgraded to MS-Office 2010, the code below works perfectly.

Thanks for that.  I've been unable to solve this issue for months!

Bart
On Jan 8, 2013, at 12:55 PM, Bart Jenkins <[email protected]> wrote:

> Yegor,
> 
> I tried POI v 3.9 and still no luck.  I am using Windows XP sp 3 with 
> MS-Office 2007.  I will try Office 2010.
> 
> What operating system are you using?  Windows XP (and what service pack) or 
> Windows 7 (or 8)?
> 
> Bart
> 
> On Nov 16, 2012, at 11:30 AM, Yegor Kozlov <[email protected]> wrote:
> 
>> I'm using the latest build from trunk and Office 2010.
>> The link to daily builds is on http://poi.apache.org/
>> 
>> On Fri, Nov 16, 2012 at 8:05 PM, Bart W Jenkins <[email protected]> wrote:
>>> Yegor,
>>> Thank you for the code, but this did NOT work for me.  Can you tell me
>>> what version of POI you are using?  I have 3.8.  With this code I get a 3 x
>>> 3 table with the column widths set as if they were nearly 0!  No matter what
>>> I set for the col sizes, the col sizes are not working.
>>> 
>>> Bart
>>> On Nov 16, 2012, at 5:12 AM, Yegor Kozlov <[email protected]> wrote:
>>> 
>>> XWPFDocument doc = new XWPFDocument();
>>> 
>>>      //column width in Twentieths of a Point
>>>      int[] cols = {2000, 2000, 2000};
>>>      XWPFTable table = doc.createTable(3, 3);
>>>      for(int i = 0; i < table.getNumberOfRows(); i++){
>>>          XWPFTableRow row = table.getRow(i);
>>>          int numCells = row.getTableCells().size();
>>>          for(int j = 0; j < numCells; j++){
>>>              XWPFTableCell cell = row.getCell(j);
>>> 
>>> cell.getCTTc().addNewTcPr().addNewTcW().setW(BigInteger.valueOf(cols[j]));
>>>          }
>>>      }
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>> 
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to