dfToAnotherPrettyTable: Another Pretty HTML Table

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Another Pretty HTML Table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
dfToAnotherPrettyTable(
  df,
  title = NULL,
  width = 400,
  footnote = NULL,
  headerFontSize = "15px",
  highlightRow = NULL,
  highlightColour = "#4daf4a",
  align = NULL,
  cellPadding = "1px 2px 1px 2px",
  cellWrapping = "nowrap"
)

Arguments

df

data frame

title

optional title for the table

width

width in pixel. default is 400

footnote

optional simple footnote

headerFontSize

font-size for the header row of the table. default is 14px.

highlightRow

optional vector containing row numbers to highlight

highlightColour

optional argument to change highlightRow colour, if highlightRow is given. default value = "#4daf4a"

align

optional vector to align table columns must have the same length as the number of columns. eg. c("left", "center", "right") also maps "lcr" -> c("left", "center", "right")

cellPadding

should be valid html, eg. 0px 2px, etc

Value

HTML Table

Examples

1
2
3
4
5
6
7
8
9
dfToAnotherPrettyTable(head(iris))
dfToAnotherPrettyTable(
  head(iris), "iris data", 800, "my note", "14px", 2, "#4daf4a",
  align = c("right", "right", "right", "right", "left")
)
dfToAnotherPrettyTable(
  head(iris), "iris data", 800, "my note", "14px", 2, "#4daf4a",
  align = "rrrrl", cellWrapping = "normal"
)

andrew-a-hale/initmediaRUtils documentation built on Aug. 25, 2020, 2:51 p.m.