tableHeader: Generate a table header or footer from column names

View source: R/datatables.R

tableHeaderR Documentation

Generate a table header or footer from column names

Description

Convenience functions to generate a table header (‘⁠<thead></thead>⁠’) or footer (‘⁠<tfoot></tfoot>⁠’) given the column names. They are basically wrappers of htmltools::tags$th applied to the column names.

Usage

tableHeader(names, escape = TRUE)

tableFooter(names, escape = TRUE)

Arguments

names

a character vector of the column names of the table (if it is an object with column names, its column names will be used instead)

escape

whether to escape the names (see datatable)

Value

A tag object generated by htmltools::tags.

Examples

library(DT)
tableHeader(iris)  # or equivalently,
tableHeader(colnames(iris))
tableFooter(iris)  # footer

library(htmltools)
tags$table(tableHeader(iris), tableFooter(iris))

DT documentation built on May 29, 2024, 8:56 a.m.