FlexTableStyle {basictabler} | R Documentation |
R6 class that specifies styling as used by the 'flextable' package.
Description
The 'FlexTableStyle' class specifies the styling for cells in a table from the flextable package.
Format
R6Class
object.
Active bindings
baseStyleName
The name of the base style in the table.
isBaseStyle
'TRUE' when this style is the equivalent of a named style in the table, 'FALSE' if this style has additional settings over and above the base style of the same name.
fontName
The name of the font (single font name, not a CSS style list).
fontSize
The size of the font (units: point).
bold
TRUE' if text is bold.
italic
'TRUE' if text is italic.
bgColor
The background colour for the cell (as a hex value, e.g. #00FF00).
textColor
The color of the text (as a hex value).
hAlign
The horizontal alignment of the text: left, center or right.
vAlign
The vertical alignment of the text: top, middle or bottom.
textRotation
The rotation angle of the text or 255 for vertical.
paddingAll
The padding to apply to all sides of each cell.
paddingLeft
The padding to apply to the left side of each cell.
paddingRight
The padding to apply to the right side of each cell.
paddingTop
The padding to apply to the top of each cell.
paddingBottom
The padding to apply to the bottom of each cell.
borderAll
A list (with elements style, color and width) specifying the border settings for all four sides of each cell at once.
borderLeft
A list (with elements style, color and width) specifying the border settings for the left border of each cell.
borderRight
A list (with elements style, color and width) specifying the border settings for the right border of each cell.
borderTop
A list (with elements style, color and width) specifying the border settings for the top border of each cell.
borderBottom
A list (with elements style, color and width) specifying the border settings for the bottom border of each cell.
Methods
Public methods
Method new()
Create a new 'FlexTableStyle' object.
Usage
FlexTableStyle$new( parentTable, baseStyleName = NULL, isBaseStyle = NULL, fontName = NULL, fontSize = NULL, bold = NULL, italic = NULL, bgColor = NULL, textColor = NULL, hAlign = NULL, vAlign = NULL, textRotation = NULL, paddingAll = NULL, paddingLeft = NULL, paddingRight = NULL, paddingTop = NULL, paddingBottom = NULL, borderAll = NULL, borderLeft = NULL, borderRight = NULL, borderTop = NULL, borderBottom = NULL )
Arguments
parentTable
Owning table.
baseStyleName
The name of the base style in the table.
isBaseStyle
'TRUE' when this style is the equivalent of a named style in the table, 'FALSE' if this style has additional settings over and above the base style of the same name.
fontName
The name of the font (single font name, not a CSS style list).
fontSize
The size of the font (units: point).
bold
'TRUE' if text is bold.
italic
'TRUE' if text is italic.
bgColor
The background colour for the cell (as a hex value, e.g. #00FF00).
textColor
The color of the text (as a hex value).
hAlign
The horizontal alignment of the text: left, center or right.
vAlign
The vertical alignment of the text: top, middle or bottom.
textRotation
The rotation angle of the text or 255 for vertical.
paddingAll
The padding to apply to all sides of each cell.
paddingLeft
The padding to apply to the left side of each cell.
paddingRight
The padding to apply to the right side of each cell.
paddingTop
The padding to apply to the top of each cell.
paddingBottom
The padding to apply to the bottom of each cell.
borderAll
A list (with elements style, color and width) specifying the border settings for all four sides of each cell at once.
borderLeft
A list (with elements style, color and width) specifying the border settings for the left border of each cell.
borderRight
A list (with elements style, color and width) specifying the border settings for the right border of each cell.
borderTop
A list (with elements style, color and width) specifying the border settings for the top border of each cell.
borderBottom
A list (with elements style, color and width) specifying the border settings for the bottom border of each cell.
Returns
No return value.
Method isBasicStyleNameMatch()
Check if this style matches the specified base style name.
Usage
FlexTableStyle$isBasicStyleNameMatch(baseStyleName = NULL)
Arguments
baseStyleName
The style name to compare to.
Returns
'TRUE' if the style name matches, 'FALSE' otherwise.
Method isFullStyleDetailMatch()
Check if this style matches the specified style properties.
Usage
FlexTableStyle$isFullStyleDetailMatch( baseStyleName = NULL, isBaseStyle = NULL, fontName = NULL, fontSize = NULL, bold = NULL, italic = NULL, bgColor = NULL, textColor = NULL, hAlign = NULL, vAlign = NULL, textRotation = NULL, paddingAll = NULL, paddingLeft = NULL, paddingRight = NULL, paddingTop = NULL, paddingBottom = NULL, borderAll = NULL, borderLeft = NULL, borderRight = NULL, borderTop = NULL, borderBottom = NULL )
Arguments
baseStyleName
The style name to compare to.
isBaseStyle
Whether the style being compared to is a base style.
fontName
The font name to compare to.
fontSize
The font size to compare to.
bold
The style property bold to compare to.
italic
The style property italic to compare to.
bgColor
The style property bgColor to compare to.
textColor
The style property textColor to compare to.
hAlign
The style property hAlign to compare to.
vAlign
The style property vAlign to compare to.
textRotation
The style property textRotation to compare to.
paddingAll
The padding to apply to all sides of each cell.
paddingLeft
The padding to apply to the left side of each cell.
paddingRight
The padding to apply to the right side of each cell.
paddingTop
The padding to apply to the top of each cell.
paddingBottom
The padding to apply to the bottom of each cell.
borderAll
The style property borderAll to compare to.
borderLeft
The style property borderLeft to compare to.
borderRight
The style property borderRight to compare to.
borderTop
The style property borderTop to compare to.
borderBottom
The style property borderBottom to compare to.
valueFormat
The style value format to compare to.
minColumnWidth
The style property minColumnWidth to compare to.
minRowHeight
The style property minRowHeight to compare to.
Returns
'TRUE' if the style matches, 'FALSE' otherwise.
Method asList()
Return the contents of this object as a list for debugging.
Usage
FlexTableStyle$asList()
Returns
A list of various object properties.
Method asJSON()
Return the contents of this object as JSON for debugging.
Usage
FlexTableStyle$asJSON()
Returns
A JSON representation of various object properties.
Method asString()
Return the contents of this object as a string for debugging.
Usage
FlexTableStyle$asString()
Returns
A character representation of various object properties.
Method clone()
The objects of this class are cloneable with this method.
Usage
FlexTableStyle$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
# This class should only be created by using the functions in the table.
# It is not intended to be created by users outside of the table.