lt_wrap: Set attributes on the table's container

View source: R/tab.R

lt_wrapR Documentation

Set attributes on the table's container

Description

Set arbitrary HTML attributes on the ⁠<div class="lt-wrap">⁠ that wraps the rendered table (e.g. style, id, ⁠data-*⁠). A class is appended to the base lt-wrap class rather than replacing it, and accumulates across repeated calls. Common uses are scoping custom CSS (e.g. attached with lt_css()) to this table alone, or giving the container a fixed width.

Usage

lt_wrap(x, ...)

Arguments

x

An lt() object.

...

Named HTML attributes for the container, e.g. class = "striped", style = "width:800px", id = "tbl1". The names and values can also be given as a single list(names, values) of two parallel vectors (see lt_label()).

Value

x with the container attributes recorded.

Examples

lt(head(mtcars)) |> lt_wrap(class = "my-table", style = "width:400px")

lt documentation built on Oct. 17, 2026, 9:06 a.m.