Page 1 of 1

formatting table row height

PostPosted: Sat Nov 20, 2010 5:51 am
by cscott530
is there a way to specify the height of a row in a table?

the xml generated (this was done in PPT, but I'd assume Word's is the same):
Code: Select all
<a:tbl>
...
<a:tblGrid>
<a:gridCol w="2057400"/>
<a:gridCol w="2006600"/>
<a:gridCol w="2032000"/>
</a:tblGrid>
...
<a:tr h="1143000">
<a:tr h="1143000">
</a:tbl>


I have no problem setting the column width (TblGridCol has setW)
I can add the rows with
Code: Select all
tbl.getEGContentRowContent().add(tr);
, as its done in TblFactory.

Unforunately org.docx4j.wml.Tr has no "H" property to set.
Same goes for TrPr, or CTTblPrEx.

Is this an oversight in the API, or is there another way to do it that I'm missing. I haven't looked into setting it on individual cells, yet; though this seems like the easier/preferrable method.

Re: formatting table row height

PostPosted: Sat Nov 20, 2010 6:43 am
by cscott530
Okay, once I actually performed the export, I got a bunch of errors for trying to add a Tbl to a Presentation. This made me realize that wml Tbl objects are (obviously) not supported by Presentations. Upon further inspection, for Presentations, the thing to use is CTTable.

CTTableRow does have this height property.

Everything is looking good now.

[note: this thread can be moved to pptx4j, it seems]