The `TableCell` class represents a cell in a table. Both header cells and body cells are represented by this class.
R6Class object.
instanceIdAn integer value that uniquely identifies this cell. NB: This number is guaranteed to be unique within the table, but the method of generation of the values may change in future, so you are advised not to base any logic on specific values.
cellTypeOne of the following values that specifies the type of cell: root, rowHeader, columnHeader, cell, total. The cellType controls the default styling that is applied to the cell.
rowNumberThe row number of the cell. 1 = the first (i.e. top) data row.
columnNumberThe column number of the cell. 1 = the first (i.e. leftmost) data column.
visibleTRUE or FALSE to specify whether the cell is rendered.
rawValueThe original unformatted value.
formattedValueThe formatted value (i.e. normally of character data type).
asNBSPTRUE or FALSE to specify whether cells with no formatted value be output as html nbsp.
fValueOrNBSPFor internal use by the renderers only.
isMergedFor internal use by the renderers only.
isMergeRootFor internal use by the renderers only.
mergeIndexFor internal use by the renderers only.
baseStyleNameThe name of the style applied to this cell (a character value). The style must exist in the TableStyles object associated with the table.
styleA TableStyle object that can apply overrides to the base style for this cell.
new()Create a new `TableCell` object.
TableCell$new( parentTable, rowNumber = NULL, columnNumber = NULL, cellType = "cell", visible = TRUE, rawValue = NULL, formattedValue = NULL, baseStyleName = NULL, styleDeclarations = NULL, asNBSP = FALSE )
parentTableOwning table.
rowNumberThe row number of the cell. 1 = the first (i.e. top) data row.
columnNumberThe column number of the cell. 1 = the first (i.e. leftmost) data column.
cellTypeOne of the following values that specifies the type of cell: root, rowHeader, columnHeader, cell, total. The cellType controls the default styling that is applied to the cell.
visible`TRUE` or `FALSE` to specify whether the cell is rendered.
rawValueThe original unformatted value.
formattedValueThe formatted value (i.e. normally of character data type).
baseStyleNameThe name of the style applied to this cell (a character value). The style must exist in the TableStyles object associated with the table.
styleDeclarationsA list containing CSS style declarations.
asNBSP`TRUE` or `FALSE` to specify whether cells with no formatted value be output as html nbsp.
No return value.
updatePosition()Set the cell location in the table. Mainly exists for internal use. Typically used after rows/columns/cells are inserted or deleted (which shifts other cells).
TableCell$updatePosition(rowNumber = NULL, columnNumber = NULL)
rowNumberThe row number of the cell. 1 = the first (i.e. top) data row.
columnNumberThe column number of the cell. 1 = the first (i.e. leftmost) data column.
No return value.
getCopy()Stub only (ignore).
TableCell$getCopy()
No return value.
asList()Return the contents of this object as a list for debugging.
TableCell$asList()
A list of various object properties.
asJSON()Return the contents of this object as JSON for debugging.
TableCell$asJSON()
A JSON representation of various object properties.
clone()The objects of this class are cloneable with this method.
TableCell$clone(deep = FALSE)
deepWhether to make a deep clone.
# 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. library(basictabler) tbl <- qtbl(data.frame(a=1:2, b=3:4)) cell1 <- tbl$cells$setCell(r=4, c=1, cellType="cell", rawValue=5) cell2 <- tbl$cells$setCell(r=4, c=2, cellType="cell", rawValue=6) tbl$renderTable()