Bolds the body cells of chosen rows, with an option to recolor their text and fill their background. Rows are chosen by index or by a filter expression; with neither, every row is bolded.
Usage
gt_bold_rows(
gt_object,
rows = NULL,
text_color = "black",
highlight_color = NULL,
row = NULL,
filter_statement = NULL
)Arguments
- gt_object
A
gttable object to modify.- rows
The rows to bold. Either an expression evaluated against the table's data, such as
mpg > 20, or a numeric vector of row indices. IfNULL, every row is bolded. Defaults toNULL.- text_color
Character. The text color for the bolded rows. Defaults to
"black".- highlight_color
Character. The background fill for the bolded rows. Set to
NULLfor no fill. Defaults toNULL.- row
Deprecated. Use
rows.- filter_statement
Deprecated. Use
rows, which takes the expression directly rather than as a string.
Details
rows is evaluated against the table's underlying data, so rows = mpg > 20
bolds the rows where that is TRUE; a numeric vector picks rows by index. The
deprecated row is passed on to rows, and the deprecated filter_statement
string, when given, takes precedence over rows. The styling is applied with a single
gt::tab_style() over gt::cells_body(), so it covers every column of the
chosen rows.
