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.
R6Class
object.
name
The unique name of the style (must be unique among the style names in the table theme).
declarations
A list containing CSS style declarations. Example: `declarations = list(font="...", color="...")`
new()
Create a new `TableStyle` object.
TableStyle$new(parentTable, styleName = NULL, declarations = NULL)
parentTable
Owning table.
styleName
A unique name for the style.
declarations
A list containing CSS style declarations. Example: `declarations = list(font="...", color="...")`
No return value.
setPropertyValue()
Set the value of a single style property.
TableStyle$setPropertyValue(property = NULL, value = NULL)
property
The CSS style property name, e.g. color.
value
The value of the style property, e.g. red.
No return value.
setPropertyValues()
Set the values of multiple style properties.
TableStyle$setPropertyValues(declarations = NULL)
declarations
A list containing CSS style declarations. Example: `declarations = list(font="...", color="...")`
No return value.
getPropertyValue()
Get the value of a single style property.
TableStyle$getPropertyValue(property = NULL)
property
The CSS style property name, e.g. color.
No return value.
asCSSRule()
Generate a CSS style rule from this table style.
TableStyle$asCSSRule(selector = NULL)
selector
The CSS selector name. Default value `NULL`.
The CSS style rule, e.g. text-align: center; color: red;
asNamedCSSStyle()
Generate a named CSS style from this table style.
TableStyle$asNamedCSSStyle(styleNamePrefix = NULL)
styleNamePrefix
A character variable specifying a prefix for all named CSS styles, to avoid style name collisions where multiple tables exist.
The CSS style rule, e.g. cell text-align: center; color: red;
getCopy()
Create a copy of this `TableStyle` object.
TableStyle$getCopy(newStyleName = NULL)
newStyleName
The name of the new style.
The new `TableStyle` object.
asList()
Return the contents of this object as a list for debugging.
TableStyle$asList()
A list of various object properties.
asJSON()
Return the contents of this object as JSON for debugging.
TableStyle$asJSON()
A JSON representation of various object properties.
clone()
The objects of this class are cloneable with this method.
TableStyle$clone(deep = FALSE)
deep
Whether to make a deep clone.
# TableStyle objects are normally created indirectly via one of the helper # methods. # For an example, see the `TableStyles` class.