Closed gilleschapron closed 8 years ago
Gilles,
FlexTable lets you manage only rotated headers text.
library(ReporteRs)
library(magrittr)
header_cells_props = cellProperties( text.direction = "btlr", background.color = "#00557F", padding = 3 )
header_text_props = textProperties( color = "white", font.size = 11, font.weight = "bold" )
MyFTable = FlexTable( data = iris[46:55,],
header.cell.props = header_cells_props,
header.text.props = header_text_props,
body.text.props = textProperties( font.size = 10 )
) %>%
setFlexTableWidths( widths = c(.5, .5, .5, .5, .8 ))
MyFTable[] = parCenter()
doc = docx( title = "title" ) %>%
addFlexTable( MyFTable )
writeDoc( doc, file = "rotated_table.docx" )
This is far from being perfect. But I am working on a new API (easier and free of java) and I will try to integrate that feature with no restrictions - issue was about being able to compute size of a string (with formats) but with gdtools
it is now possible.
David
Thanks a lot for you answer and the example. My intention was indeed to use it on text, but on rows (first column). Never mind, I'll be waiting for your work. A new API free of java, what an exiting news! Good luck with that.
Gilles
Not yet ready, but here is the first version. Will be integrated into ReporteRs later.
https://davidgohel.github.io/flextable/articles/introduction.html
David
David,
I was wondering if it was possible to define rotation of text in Flextable's cells. In cellProperties help, there is a text.direction argument with 3 possibilies: "lrtb", "tbrl", "btlr". But when I try to use it, I see no difference. Is it normal ? Thanks for any help.
Hereafter an exemple: