caption: Set the table caption

View source: R/properties-table.R

captionR Documentation

Set the table caption

Description

By default, captions are displayed above the table. You can change this with caption_pos().

Usage

caption(ht)

caption(ht) <- value

set_caption(ht, value)

Arguments

ht

A huxtable.

value

A string. Set to NA to reset to the default, which is NA_character_.

Details

Captions are not escaped. See the example for a workaround.

Value

property() returns the property value(s). set_property() and map_property() return the modified huxtable.

See Also

Other caption properties: caption_pos(), caption_width()

Examples


set_caption(jams, "Pots of jam for sale")
# escape caption characters:
caption(jams) <- sanitize(
  "Make $$$ with jam",
  type = "latex"
)


huxtable documentation built on Aug. 19, 2025, 1:12 a.m.