huxtable (version 4.4.0)

valign: Vertical alignment

Description

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

Usage

valign(ht)
valign(ht) <- value
set_valign(ht, row, col, value, byrow = FALSE)
map_valign(ht, row, col, fn)

Arguments

ht

A huxtable.

value

A character vector or matrix which may be "top", "middle", "bottom" or NA.

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

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 valign, the valign property. For set_valign and map_valign, the modified huxtable.

Details

Vertical alignment may not work for short text in LaTeX. Defining row heights with row_height() may help.

Examples

Run this code
# NOT RUN {
valign(jams) <-  "bottom"
valign(jams)


jams2 <- set_valign(jams,
      "bottom")
valign(jams2)

jams3 <- set_valign(jams,
      2:3, 1, "bottom")
valign(jams3)

jams4 <- map_valign(jams,
      by_rows(
        "bottom",
        "bottom")
      )
valign(jams4)
# }

Run the code above in your browser using DataCamp Workspace