table.rows | R Documentation |
Many functions exist in R to generate HTML tables. These functions are
useful for generating HTML table fragments (rather than whole tables), which
can then be used to build up complete tables. The first column my be used to
label the rows of the table. Row labels, if specified, can have a special
HTML class
designated, which can be useful as a hook to customize
their appearance using CSS. The same is true for the the first and last row
of cells.
table.rows( x, row.labels = rownames(x), th = FALSE, class = NULL, rowlabelclass = "rowlabel", firstrowclass = "firstrow", lastrowclass = "lastrow", ... ) table.data( x, row.labels = rownames(x), th = FALSE, class = NULL, rowlabelclass = "rowlabel", firstrowclass = "firstrow", lastrowclass = "lastrow", ... )
x |
A vector or table-like structure (e.g. a |
row.labels |
Values for the first column, typically used to label the row, or |
th |
A logical. Should |
class |
HTML class attribute. Can be a single |
rowlabelclass |
HTML class attribute for the row labels (i.e. first column). |
firstrowclass |
HTML class attribute for the first row of cells. |
lastrowclass |
HTML class attribute for the last row of cells. |
... |
Additional arguments. |
A character
which contains an HTML table fragment.
table.data()
: Convert to HTML table data (cells).
x <- matrix(signif_pad(exp(rnorm(5*5, 1, 1))), 5, 5) table.data(x) cat(table.rows(x, NULL)) cat(table.rows(x, LETTERS[1:nrow(x)])) cat(table.rows(LETTERS[1:3], "Headings", th=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.