| TableOpenXlsxStyles | R Documentation |
The 'TableOpenXlsxStyles' class stores a collection of 'TableTableOpenXlsx' style objects.
R6Class object.
countThe number of styles in the collection.
stylesA list of 'TableOpenXlsxStyle' objects that comprise the collection.
new()Create a new 'TableOpenXlsxStyles' object.
TableOpenXlsxStyles$new(parentTable)
parentTableOwning table.
No return value.
clearStyles()Clear the collection removing all styles.
TableOpenXlsxStyles$clearStyles()
No return value.
findNamedStyle()Find a style in the collection matching the specified base style name.
TableOpenXlsxStyles$findNamedStyle(baseStyleName)
baseStyleNameThe style name to find.
A 'TableTableOpenXlsx' object that is the style matching the specified base style name or 'NULL' otherwise.
findOrAddStyle()Find a style in the collection matching the specified base style name and style properties. If there is no matching style, then optionally add a new style.
TableOpenXlsxStyles$findOrAddStyle( action = "findOrAdd", baseStyleName = NULL, isBaseStyle = NULL, style = NULL, mapFromCss = TRUE )
actionThe action to carry out. Must be one of "find", "add" or "findOrAdd" (default).
baseStyleNameThe style name to find/add.
isBaseStyleIs the style to be found/added a base style?
styleA 'TableStyle' object specifying style properties to be found/added.
mapFromCss'TRUE' (default) to map the basictabler CSS styles to corresponding Excel styles, 'FALSE' to apply only the specified xl styles.
A 'TableTableOpenXlsx' object that is the style matching the specified base style name or 'NULL' otherwise.
addNamedStyles()Populate the OpenXlsx styles based on the styles defined in the table.
TableOpenXlsxStyles$addNamedStyles(mapFromCss = TRUE)
mapFromCss'TRUE' (default) to map the basictabler CSS styles to corresponding Excel styles, 'FALSE' to apply only the specified xl styles.
No return value.
asList()Return the contents of this object as a list for debugging.
TableOpenXlsxStyles$asList()
A list of various object properties.
asJSON()Return the contents of this object as JSON for debugging.
TableOpenXlsxStyles$asJSON()
A JSON representation of various object properties.
asString()Return the contents of this object as a string for debugging.
TableOpenXlsxStyles$asString(seperator = ", ")
seperatorDelimiter used to combine multiple values into a string.
A character representation of various object properties.
clone()The objects of this class are cloneable with this method.
TableOpenXlsxStyles$clone(deep = FALSE)
deepWhether to make a deep clone.
# This class should not be used by end users. It is an internal class
# created only by the BasicTable class. It is used when rendering to Excel.
library(basictabler)
tbl <- qtbl(data.frame(a=1:2, b=3:4))
library(openxlsx)
wb <- createWorkbook(creator = Sys.getenv("USERNAME"))
addWorksheet(wb, "Data")
tbl$writeToExcelWorksheet(wb=wb, wsName="Data",
topRowNumber=1, leftMostColumnNumber=1,
applyStyles=TRUE, mapStylesFromCSS=TRUE)
# Use saveWorkbook() to save the Excel file.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.