The label is used as the table's label in LaTeX, and as the "id" property of the table element in HTML.
label(ht)
label(ht) <- value
set_label(ht, value)property() returns the property value(s).
set_property() and map_property() return the modified huxtable.
LaTeX table labels typically start with "tab:".
Within knitr, huxtable labels will default to the same as the knitr chunk label.
To turn off this behaviour, set options(huxtable.autolabel = FALSE).
If you use bookdown, and set a label on your
table, the table caption() will automatically be prefixed with (#label).
You can then refer to the table using @ref(label). label needs to start
with "tab:"; if it doesn't, the "tab:" prefix will be added
automatically. To turn off this behaviour, set
options(huxtable.bookdown = FALSE).
huxtable-options
set_label(jams, "tab:mytable")
#> Type Price
#> Strawberry 1.90
#> Raspberry 2.10
#> Plum 1.80
#>
#> Column names: Type, Price