Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tableHeader

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

A Wrapper of the JavaScript Library 'DataTables'

v0.18
GPL-3 | file LICENSE
Authors
Yihui Xie [aut, cre], Joe Cheng [aut], Xianying Tan [aut], JJ Allaire [ctb], Maximilian Girlich [ctb], Greg Freedman Ellis [ctb], Johannes Rauh [ctb], jQuery contributors [ctb, cph] (jQuery in htmlwidgets/lib), SpryMedia Limited [ctb, cph] (DataTables in htmlwidgets/lib), Brian Reavis [ctb, cph] (selectize.js in htmlwidgets/lib), Leon Gersen [ctb, cph] (noUiSlider in htmlwidgets/lib), Bartek Szopka [ctb, cph] (jquery.highlight.js in htmlwidgets/lib), RStudio, PBC [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.