Documentation Index
Fetch the complete documentation index at: https://mintlify.com/davidgohel/flextable/llms.txt
Use this file to discover all available pages before exploring further.
highlight() changes the text highlight color of a selection of cells in a flextable. This sets the background color of the text characters themselves (not the cell background). You can supply a fixed color string or a function that derives colors from column values.
Function signature
Parameters
A
flextable object.Row selector. Accepts integer indices, a one-sided formula (e.g.,
~ col > 5), or a logical vector. NULL selects all rows in the specified part.Column selector. Accepts integer indices, column names, a formula, or a logical vector.
NULL selects all columns.A CSS-compatible color string (e.g.,
"yellow", "#FFFF00") or a function that accepts a vector of data values and returns a character vector of color strings.Which part of the table to target:
"body", "header", "footer", or "all".When
color is a function, source specifies which dataset column(s) are passed as input to the function. This allows highlighting cells in j based on values from a different (possibly hidden) column. Defaults to j.Return value
The modifiedflextable object.