huxtable (version 4.6.0)

align: Alignment

Description

Functions to get or set the alignment property of huxtable cells.

Usage

align(ht)
align(ht) <- value
set_align(ht, row, col, value, byrow = FALSE)
map_align(ht, row, col, fn)

Arguments

ht

A huxtable.

value

A character vector or matrix which may be "left", "center", "right" , NA or a single character.

Set to NA to reset to the default, which is "left".

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 align, the align property. For set_align and map_align, the modified huxtable.

Details

This sets the horizontal alignment of the cell. If value is a single character (e.g. a decimal point), then the cell is aligned on this character.

Examples

Run this code
# NOT RUN {
align(jams) <-  "right"
align(jams)


set_align(jams, "right")
set_align(jams,
      2:3, 1, "right")
map_align(jams,
      by_rows("right", "left"))
# }

Run the code above in your browser using DataCamp Workspace