powered by
add font for cell region
wb_add_font( wb, sheet = current_sheet(), dims = "A1", name = "Calibri", color = wb_color(hex = "FF000000"), size = "11", bold = "", italic = "", outline = "", strike = "", underline = "", charset = "", condense = "", extend = "", family = "", scheme = "", shadow = "", vert_align = "", ... )
The wbWorksheetObject, invisibly
wbWorksheetObject
a workbook
the worksheet
the cell range
font name: default "Calibri"
rgb color: default "FF000000"
font size: default "11",
bold, "single" or "double", default: ""
italic
outline
strike
underline
charset
condense
extend
font family
font scheme
shadow
vertical alignment
...
add_font provides all the options openxml accepts for a font node, not all have to be set. Usually name, size and color should be what the user wants.
Other styles: wb_add_border(), wb_add_cell_style(), wb_add_fill(), wb_add_numfmt(), wb_clone_sheet_style()
wb_add_border()
wb_add_cell_style()
wb_add_fill()
wb_add_numfmt()
wb_clone_sheet_style()
wb <- wb_workbook() %>% wb_add_worksheet("S1") %>% wb_add_data("S1", mtcars) wb %>% wb_add_font("S1", "A1:K1", name = "Arial", color = wb_color(theme = "4"))
Run the code above in your browser using DataLab