Skip to main content

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.

italic() changes the font decoration (italic style) of a selection of cells in a flextable.

Function signature

italic(x, i = NULL, j = NULL, italic = TRUE, part = "body")

Parameters

x
flextable
required
A flextable object.
i
integer | formula | logical
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.
j
integer | character | formula
Column selector. Accepts integer indices, column names, a formula, or a logical vector. NULL selects all columns.
italic
logical
default:"TRUE"
TRUE to apply italic, FALSE to remove it.
part
string
default:"body"
Which part of the table to target: "body", "header", "footer", or "all".

Return value

The modified flextable object.

Examples

Make the header row italic:
ft <- flextable(head(mtcars))
ft <- italic(ft, italic = TRUE, part = "header")
ft
Italicise specific rows using a formula:
ft <- flextable(head(iris))
ft <- italic(ft, i = ~ Sepal.Length > 5, j = "Species")
ft

See also

Build docs developers (and LLMs) love