Converts a matrix (or vector) to a <table> HTML fragment, with
optional row/column headers, caption, per-column alignment and widths.
The result has class c("html", "character") (see
as.html()) and prints as a formatted text table via
preview.html().
Usage
toHtmlTable(
m,
sepCol = FALSE,
caption = "",
bodyAlign = "center",
valign = "top",
width = NULL,
cellpadding = 3,
border = 0,
tableWidth = NA,
captionAlign = "center",
frame = TRUE,
rowNames = TRUE,
colNames = TRUE
)Arguments
- m
a matrix or vector
- sepCol
logical; if
TRUE, insert a narrow empty separator column between each pair of columns- caption
table caption text
- bodyAlign
horizontal alignment of body cells (
"left","center","right"), recycled to the number of columns- valign
vertical alignment of body cells (HTML
valignattribute:"top","middle","bottom"), recycled to the number of columns- width
column width(s) (HTML
widthattribute), recycled to the number of columns including an optional rowname column; useNAfor columns without an explicit width- cellpadding
HTML
cellpaddingattribute- border
HTML
borderattribute- tableWidth
overall table width (HTML
widthattribute on<table>), orNAfor none- captionAlign
horizontal alignment of the header row cells
- frame
logical; if
TRUE, draw outer frame and group rules (frame="hsides" rules="groups")- rowNames
logical; render the row names as a leading header column. Ignored when
mhas none- colNames
logical; render the column names as a header row. Ignored when
mhas none
See also
Other html:
as.fileLink(),
as.html(),
as.img(),
embedFile(),
escapeHtml(),
htmlNotation,
htmlSubscript
