huxtable (version 4.4.0)

wrap: Text wrapping

Description

Functions to get or set the text wrapping property of huxtable cells.

Usage

wrap(ht)
wrap(ht) <- value
set_wrap(ht, row, col, value, byrow = FALSE)
map_wrap(ht, row, col, fn)

Arguments

ht

A huxtable.

value

A logical vector or matrix. If TRUE, long cell contents will be wrapped into multiple lines.

Set to NA to reset to the default, which is FALSE.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

fn

A mapping function. See mapping-functions for details.

byrow

Deprecated. Use by_cols() instead.

Value

For wrap, the wrap property. For set_wrap and map_wrap, the modified huxtable.

Examples

Run this code
# NOT RUN {
ht <- huxtable(paste(
      rep("Some long text.", 20),
      collapse = " "))
width(ht) <- 0.2
wrap(ht) <- TRUE
# }
# NOT RUN {
  quick_html(ht)
# }
# NOT RUN {

jams2 <- set_wrap(jams,
      TRUE)
wrap(jams2)

jams3 <- set_wrap(jams,
      2:3, 1, TRUE)
wrap(jams3)

jams4 <- map_wrap(jams,
      by_rows(
        TRUE,
        FALSE)
      )
wrap(jams4)
# }

Run the code above in your browser using DataLab