huxtable (version 0.3.0)

bold: Cell text style

Description

Functions to get or set the cell text style property of huxtable table cells.

Usage

bold(ht)
bold(ht) <- value
set_bold(ht, row, col, value, byrow = FALSE)

italic(ht) italic(ht) <- value set_italic(ht, row, col, value, byrow = FALSE)

Arguments

ht

A huxtable.

value

A logical vector or matrix Set to NA to reset to the default.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

byrow

If TRUE, fill in values by row rather than by column.

Value

For bold, the bold attribute. For set_bold, the ht object.

See Also

Other formatting functions: background_color, font_size, font, na_string, number_format, text_color

Examples

Run this code
# NOT RUN {
ht <- huxtable(a = 1:3, b = 1:3)
bold(ht) <-  TRUE
bold(ht)
print_screen(ht)

ht <- huxtable(a = 1:3, b = 3:1)
ht2 <- set_bold(ht, TRUE)
bold(ht2)
ht3 <- set_bold(ht, 1:2, 1, TRUE)
bold(ht3)
ht4 <- set_bold(ht, 1:2, 1:2, c(TRUE, FALSE), byrow = TRUE)
bold(ht4)
ht5 <- set_bold(ht, where(ht == 1), TRUE)
bold(ht5)
# }

Run the code above in your browser using DataCamp Workspace