R/FlexTableRenderer.R
FlexTableRenderer.Rd
The `FlexTableRenderer` class creates a representation of a table using the `flextable` package. See the Output vignette for more details.
R6Class
object.
new()
Create a new `FlexTableRenderer` object.
FlexTableRenderer$new(parentTable)
parentTable
Owning table.
No return value.
writeToCell()
Write a value to a cell, optionally with styling and cell merging.
FlexTableRenderer$writeToCell( ft = NULL, rowNumber = NULL, columnNumber = NULL, totalRowCount = NULL, totalColumnCount = NULL, value = NULL, applyStyles = TRUE, baseStyleName = NULL, style = NULL, mapFromCss = TRUE, mergeRows = NULL, mergeColumns = NULL )
ft
The flextable to write to.
rowNumber
The row number of the cell where the value is to be written.
columnNumber
The column number of the cell where the value is to be written.
value
The value to be written. Since the flextable is created from a data frame, this argument can be omitted.
applyStyles
`TRUE` (default) to also set the styling of the cell, `FALSE` to only write the value.
baseStyleName
The name of the style from the table theme to apply to the cell.
style
A `TableStyle` object that contains additional styling to apply to the cell.
mapFromCss
`TRUE` (default) to map the basictabler CSS styles to corresponding Excel styles, `FALSE` to apply only the specified xl styles.
mergeRows
If the cell is to be merged with adjacent cells, then an integer or numeric vector specifying the row numbers of the merged cell. NULL (default) to not merge cells.
mergeColumns
If the cell is to be merged with adjacent cells, then an integer or numeric vector specifying the column numbers of the merged cell. NULL (default) to not merge cells.
The updated flextable definition.
writeBorder()
Write the borders of a cell.
FlexTableRenderer$writeBorder( ft = NULL, rowNumber = NULL, columnNumber = NULL, totalRowCount = NULL, totalColumnCount = NULL, border = NULL, borderLeft = NULL, borderRight = NULL, borderTop = NULL, borderBottom = NULL )
ft
The flextable to write to.
rowNumber
The row number of the cell where the border is to be written.
columnNumber
The column number of the cell where the border is to be written.
totalRowCount
The total number of rows in the table.
totalColumnCount
The total number of columns in the table.
border
The border to be applied to all sides of the cell (unless a border is specified using the other arguments).
borderLeft
The border to apply to the left side of the cell.
borderRight
The border to apply to the right side of the cell.
borderTop
The border to apply to the top side of the cell.
borderBottom
The border to apply to the bottom side of the cell.
The updated flextable definition.
asFlexTable()
Convert table to a flextable table.
FlexTableRenderer$asFlexTable(applyStyles = TRUE, mapStylesFromCSS = TRUE)
applyStyles
`TRUE` (default) to also set the styling of the cells, `FALSE` to only write the value.
mapStylesFromCSS
`TRUE` (default) to map the basictabler CSS styles to corresponding flextable styles where possible, `FALSE` to apply only the specified ft styles.
No return value.
clone()
The objects of this class are cloneable with this method.
FlexTableRenderer$clone(deep = FALSE)
deep
Whether 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 converting to a # flextable.