Dear R and odfWeave users,
I am trying to figure out how to control table width and alignment on the
page for a table generated by odfTable. Based on reading odfWeave
documentation (including formattingOut.odt), here is how I manipulate the
styles:
st = getStyleDefs()
# modify the table style
tab = getStyles()$table
st[[tab]]$align = "center" # seems to have no effect
st[[tab]]$marginLeft = "2.0 in" # seems to have no effect
setStyleDefs(st)
My table always ends up fully justified (taking all page width). When I
check Table Format in the output .odf, Alignment is always "Automatic". When
doing Column/Optimal Width on the table, the table shrinks but becomes left
aligned, not centered.
The table style is understood by odfWeave -- here is the output I get after
sourcing my style definition file:
> getStyles()$table
[1] "RTable1"
> getStyleDefs()[[getStyles()$table]]
$type
[1] "Table"
$marginLeft
[1] "2.0 in"
$marginRight
[1] "0.05in"
$marginTop
[1] "0.05in"
$marginBottom
[1] "0.05in"
$align
[1] "center"
I am not sure why these style options do not seem to have effect on the
output. My specific questions are:
(1) How do I get table alignment to work?
(2) Is the only way to control table width via setting the margins in the
$table style? What am I doing wrong in the above style code?
(3) What about column width -- is it possible to automatically size columns
to fit the content, like selecting Column/Optimal Width but programmatically
via odfWeave?
Thank you,
Aleksey
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.