Specify display properties for a single table column
tfl_colspec.RdCreates a column specification object for use with tfl_table(). All
arguments are optional — unspecified properties fall back to the
corresponding flat argument in tfl_table(), or to type-based defaults.
You can use tfl_colspec() for fine-grained per-column control, or use the
flat arguments of tfl_table() (col_widths, col_labels, col_align,
wrap_cols) for simpler cases. When both are provided for the same column,
the tfl_colspec() entry takes priority.
Arguments
- col
Character scalar. Column name in the data frame passed to
tfl_table().- label
Character scalar or
NULL. Display label for the column header.NULLuses the column name. Use"\n"for multiline headers.- width
A
unitobject (e.g.unit(1.5, "inches")) or a plain positive numeric (treated as a relative weight; columns with relative weights are scaled to fill available width after fixed-width columns are placed).NULLtriggers content-based auto-sizing.- align
Character scalar:
"left","right", or"centre".NULLdefaults to"right"for numeric columns and"left"otherwise.- wrap
Logical. Whether this column is eligible for word-wrapping when total column widths exceed available width.
- gp
A
gpar()object to overridetfl_table()'sgp$group_colfor this specific column. Only valid for row-header (group) columns; an error is raised if applied to a data column.