OpenOffice-OODoc - trouble with column width

Posted on Tue Oct 2 23:21:54 2007 by namotco8
trouble with column width
I saw the previous post about column width. I've tried that, but I'm still getting the default. I'm able to set cell styles, but not column or other table attributes. Here are some things I've tried:
my $c1Style = $document->columnStyle($rectable, 0); $document->updateStyle($c1Style, properties => { area => 'table-column', 'style:column-width' => '1cm', 'style:use-optimal-column-width' => 'false' });
Also:
$document->createStyle("Narrow", family=>'table-column', parent=> "Default", properties=>{ area => 'table-column', 'style:column-width' => '1cm' } ); my $colom=$document->getColumn($rectable, 0); $document->columnStyle($colom,'Narrow');
What I'm doing is:
my $rectable = $document->insertTable ( $recommendationSect, $tname , @{$href->{$opts}->{$val}} +1 , 3, 'table-style' => 'borders1pt', #'cell-type' => default cell type 'cell-style' => 'noBordersCell', 'text-style' => 'P1' ); $document->moveElementsToSection('recommendations', $rectable); # ... then I add some values and cell styling like so: $document->cellValue($tname, $rrcnt,0, " -".uc($rec->{andor})."- " ) unless ($hr || $rec->{medCa +tegory} eq 'Discontinue'); $document->cellStyle($tname, $rrcnt, 1, 'currentMedTableRowCell') if $hr; # add some space at the end of the table next: my $p = $document->insertParagraph($rectable, "\n", 'position' => 'after'); $document->setText($p, "\n\n"); # Next I try some table styles which don't seem to work (I check in the XML...) $document->updateStyle($tstyle, properties => { 'fo:border-top' => "0.00695 solid #000000", 'fo:border-bottom' => "0.00695 solid #000000", 'fo:border-left' => "none", 'fo:border-right' => "none", 'fo:background-color' => "#007BC2", 'width' => "6.5in", 'style:may-break-between-rows' => "false" }); # and then column widths which also don't work: my $c1Style = $document->columnStyle($rectable, 0); $document->updateStyle($c1Style, properties => { area => 'table-column', 'style:column-width' => '1cm', 'style:use-optimal-column-width' => 'false' }); my $c2Style = $document->columnStyle($rectable, 1); $document->updateStyle($c2Style, properties => { 'style:rel-column-width' => "5815*", area => 'table-column', 'style:column-width' => '4.0382in', 'style:use-optimal-column-width' => 'false' }); my $c3Style = $document->columnStyle($rectable, 2); $document->updateStyle($c3Style, properties => { 'style:rel-column-width' => "3324*", area => 'table-column', 'style:column-width' => '2.3083in', 'style:use-optimal-column-width' => 'false' });
I don't understand where I've gone wront...
Direct Responses: 6984 | Write a response