tableAsHTML | R Documentation |
Generate HTML code for a table output. Assumes table has more than one row.
tableAsHTML(
t,
row.names = NULL,
column.names = NULL,
html.table.border = 0,
banded.rows = FALSE,
col.odd = "none",
col.even = "lightgrey",
caption = NA
)
t |
a matrix |
row.names |
(optional) vector of row names in table |
column.names |
(optional) vector of column names in table |
html.table.border |
border type for the table. Defaults to 0 in HTML syntax. |
banded.rows |
logical; if |
col.odd |
colour to use for odd numbered rows |
col.even |
colour to use for even numbered rows |
caption |
table caption. Uses |
A character string that can be parsed as HTML code to produce a nicer table output.
Samuel Leung, Derek Chiu
library(htmlTable)
A <- matrix(c(2, 3, 5, 10), nrow = 2, dimnames = list(c("Row1", "Row2"), c("Col1", "Col2")))
htmlTable(tableAsHTML(A, banded.rows = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.