powered by
This function enhances the gt package's tab_header function by allowing the inclusion of a label for referencing the table in LaTeX documents.
tab_header_lbl(data, title, subtitle = NULL, label = NULL)
LaTeX-formatted table header.
A gt table object.
Title of the table.
Subtitle of the table.
Label for referencing the table in LaTeX.
Be sure to use this function at the end of gt format functions. This function returns a LaTeX-formatted table header.
require(gt) head(iris) |> gt() |> tab_header_lbl(title = "iris",label = "tab:iris") |> cat()
Run the code above in your browser using DataLab