
Last chance! 50% off unlimited learning
Sale ends in
apply a rotation to cell text
rotate(x, i = NULL, j = NULL, rotation, align = "center",
part = "body")
a flextable object
rows selection
columns selection
one of "lrtb", "tbrl", "btlr"
vertical alignment of paragraph within cell, one of "center" or "top" or "bottom".
partname of the table (one of 'all', 'body', 'header', 'footer')
One common case is to rotate text to minimise column space. When rotating,
paragraph alignments will remain the same and often right aligned (
with an effect of top aligned when rotated). Use
align(..., align = "center")
to center rotated text.
When function autofit
is used, the rotation will be
ignored.
Other sugar functions for table style: align
,
bg
, bold
,
color
, empty_blanks
,
fontsize
, font
,
italic
, padding
,
valign
# NOT RUN {
ft <- flextable(head(iris))
ft <- rotate(ft, rotation = "tbrl", part = "header", align = "center")
ft <- align(ft, align = "center")
ft <- autofit(ft)
ft <- height(ft, height = max(dim_pretty(ft, part = "header")$widths), part = "header")
# }
Run the code above in your browser using DataLab