#' excel_colnamesStyle
#'
#' @param wbCon
#' @param fontHeight
#' @param fontBold
#' @param fontItalic
#' @param fontName
#' @param fontColor
#' @param fillBackgroundColor
#' @param fillForegroundColor
#' @param fillPattern
#' @param borderColor
#' @param borderPosition
#' @param borderPen
#' @param alignmentH
#' @param alignmentV
#'
#' @return
#' @export
#'
#' @examples
excel_colnamesStyle <- function(wbCon,
fontHeight = 14,
fontBold = T,
fontItalic = F,
fontName = "Calibri",
fontColor = "white",
fillBackgroundColor = "#2ca25f",
fillForegroundColor = "#2ca25f",
fillPattern = "SOLID_FOREGROUND",
borderColor = "black",
borderPosition = c("TOP", "BOTTOM", "LEFT", "RIGHT"),
borderPen=c("BORDER_THIN", "BORDER_THIN", "BORDER_THIN", "BORDER_THIN") ,
alignmentH = "ALIGN_RIGHT",
alignmentV = "VERTICAL_CENTER"
) {
style <- xlsx::CellStyle(wbCon) +
xlsx::Font(wbCon, heightInPoints=fontHeight, isBold=fontBold, isItalic=fontItalic,
name=fontName, color=fontColor) +
xlsx::Fill(backgroundColor = fillBackgroundColor, foregroundColor = fillForegroundColor,
pattern = fillPattern) +
xlsx::Border(color=borderColor,
position=borderPosition,
pen=borderPen) +
xlsx::Alignment(h=alignmentH, v = alignmentV)
return(style)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.