| TableStyle {basictabler} | R Documentation |
R6 class that specifies styling.
Description
The 'TableStyle' class specifies the styling for headers and cells in a table. Styles are specified in the form of Cascading Style Sheet (CSS) name-value pairs.
Format
R6Class object.
Active bindings
nameThe unique name of the style (must be unique among the style names in the table theme).
declarationsA list containing CSS style declarations. Example: 'declarations = list(font="...", color="...")'
Methods
Public methods
Method new()
Create a new 'TableStyle' object.
Usage
TableStyle$new(parentTable, styleName = NULL, declarations = NULL)
Arguments
parentTableOwning table.
styleNameA unique name for the style.
declarationsA list containing CSS style declarations. Example: 'declarations = list(font="...", color="...")'
Returns
No return value.
Method setPropertyValue()
Set the value of a single style property.
Usage
TableStyle$setPropertyValue(property = NULL, value = NULL)
Arguments
propertyThe CSS style property name, e.g. color.
valueThe value of the style property, e.g. red.
Returns
No return value.
Method setPropertyValues()
Set the values of multiple style properties.
Usage
TableStyle$setPropertyValues(declarations = NULL)
Arguments
declarationsA list containing CSS style declarations. Example: 'declarations = list(font="...", color="...")'
Returns
No return value.
Method getPropertyValue()
Get the value of a single style property.
Usage
TableStyle$getPropertyValue(property = NULL)
Arguments
propertyThe CSS style property name, e.g. color.
Returns
No return value.
Method asCSSRule()
Generate a CSS style rule from this table style.
Usage
TableStyle$asCSSRule(selector = NULL)
Arguments
selectorThe CSS selector name. Default value 'NULL'.
Returns
The CSS style rule, e.g. text-align: center; color: red;
Method asNamedCSSStyle()
Generate a named CSS style from this table style.
Usage
TableStyle$asNamedCSSStyle(styleNamePrefix = NULL)
Arguments
styleNamePrefixA character variable specifying a prefix for all named CSS styles, to avoid style name collisions where multiple tables exist.
Returns
The CSS style rule, e.g. cell text-align: center; color: red;
Method getCopy()
Create a copy of this 'TableStyle' object.
Usage
TableStyle$getCopy(newStyleName = NULL)
Arguments
newStyleNameThe name of the new style.
Returns
The new 'TableStyle' object.
Method asList()
Return the contents of this object as a list for debugging.
Usage
TableStyle$asList()
Returns
A list of various object properties.
Method asJSON()
Return the contents of this object as JSON for debugging.
Usage
TableStyle$asJSON()
Returns
A JSON representation of various object properties.
Method clone()
The objects of this class are cloneable with this method.
Usage
TableStyle$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
# TableStyle objects are normally created indirectly via one of the helper
# methods.
# For an example, see the `TableStyles` class.