OpenOffice-OODoc - Re: trouble with column width

Posted on Thu Jan 31 23:27:46 2008 by keithjr in response to 6158 (See the whole thread of 2)
Re: trouble with column width
I was having the same trouble, but managed to get it working using a different style property. Try replacing column-width with rel-column-width, like so:
$doc->createStyle("ColS", family=>'table-column', parent=> "Default", properties=> { area => 'table-column', 'style:rel-column-width' => "100*" }); $doc->createStyle("ColM", family=>'table-column', parent=> "Default", properties=> { area => 'table-column', 'style:rel-column-width' => "200*" }); $doc->createStyle("ColL", family=>'table-column', parent=> "Default", properties=> { area => 'table-column', 'style:rel-column-width' => "300*" }); my $col; $col = $doc->getColumn($table,0); $doc->columnStyle($col,'ColS'); $col = $doc->getColumn($table,1); $doc->columnStyle($col,'ColM'); $col = $doc->getColumn($table,2); $doc->columnStyle($col,'ColL');
Basically, the width of each column is the column's rel-column-width number divided by the total sum of all rel-column-width markers in the table. So, the third column would be 1/2 the table width, for example. Also, each number needs an asterisk trailing it (ODF requirement). I couldn't get the fixed widths to work at all, even though they seemed to be correct in the generated XML.
Write a response