htmlTable: Generate an HTML Table

Description Usage Arguments Examples

View source: R/htmlTable.R

Description

This function is used to generate an HTML table; it wraps to knitr::kable but gives some 'extras'; in particular, it allows us to set the class, id, and other HTML attributes.

Usage

1
2
htmlTable(x, class = "table table-condensed table-hover", id = NULL,
  style = NULL, attr = NULL, output = TRUE, ...)

Arguments

x

A data.frame or matrix.

class

The CSS class to give the table. By default, we use Twitter bootstrap styling – for this to take effect, your document must include bootstrap CSS.

id

The CSS id to give the table.

style

Custom styling to apply to the table.

attr

Other attributes we wish to apply to the table.

output

Whether we should write the output to the console. We hijack the kable argument.

...

Optional arguments passed to kable.

Examples

1
2
3
df <- data.frame(`P Values`=runif(1000), Group=1:1000)
htmlTable( head(df[ order(df$P, decreasing=FALSE), ]) )
## wow! look at all that significance! ...

Kmisc documentation built on May 29, 2017, 1:43 p.m.

Related to htmlTable in Kmisc...