Text styling
For text styling you can pass either one of the options or options in a
vector. For example if you would like to have text that is bold and
italised then set:
fmt <- xlr_format(text_style = c("bold", "italic"))
If you would like to the text to be only bold then:
fmt <- xlr_format(text_style = "bold")
Border styling
The three arguments to create border styling are border
, border_colour
,
and border_style
. They each take either a vector, where you specify to
change what borders to have in each cell and what they look like. To specify
that you want a border around a cell, use border
, you need to pass a vector
of what sides you want to have a border (or a single element if it's only one
side). For example:
"top"
the top border
"left"
the left border
c("bottom", "right")
the top and bottom border
c("left", "right", "bottom")
the left, right and bottom borders
c("top","right","bottom","left")
the borders for all sides of the cells
Based on this you can use border_colour
to set the border colours. If you
want all the same border colour, just pass a character representing the colour
you want (e.g. set border_colour = "blue"
if you'd like all borders to be
blue). Alternatively you can pass a vector the same length as the vector
that you passed to border
, with the location specifying the colour. For example,
if you set:
fmt <- xlr_format(border = c("left", "top"),
border_colour = c("blue","red"))
the top border will be red, and the left border will be blue. You set the pattern
in the same way for border_style
. Alternatively if you only wanted it to
be dashed with default colours. You'd set:
fmt <- xlr_format(border = c("left", "top"),
border_style = "dashed")