View source: R/htmlTable_theme.R
setHtmlTableTheme | R Documentation |
htmlTable()
The theme guides many of the non-data objects visual appearance. The
theme can be over-ridden by settings for each table. Too get a more complete
understanding of the options, see addHtmlTableStyle()
.
setHtmlTableTheme(
theme = NULL,
align = NULL,
align.header = NULL,
align.cgroup = NULL,
css.rgroup = NULL,
css.rgroup.sep = NULL,
css.tspanner = NULL,
css.tspanner.sep = NULL,
css.total = NULL,
css.cell = NULL,
css.cgroup = NULL,
css.header = NULL,
css.header.border_bottom = NULL,
css.class = NULL,
css.table = NULL,
pos.rowlabel = NULL,
pos.caption = NULL,
col.rgroup = NULL,
col.columns = NULL,
padding.rgroup = NULL,
padding.tspanner = NULL,
spacer.celltype = NULL,
spacer.css.cgroup.bottom.border = NULL,
spacer.css = NULL,
spacer.content = NULL
)
theme |
A |
align |
A character strings specifying column alignments, defaulting to |
align.header |
A character strings specifying alignment for column header,
defaulting to centered, i.e. |
align.cgroup |
The justification of the |
css.rgroup |
CSS style for the rgroup, if different styles are wanted for each of the rgroups you can just specify a vector with the number of elements. |
css.rgroup.sep |
The line between different rgroups. The line is set to the TR element of the lower rgroup, i.e. you have to set the border-top/padding-top etc to a line with the expected function. This is only used for rgroups that are printed. You can specify different separators if you give a vector of rgroup - 1 length (this is since the first rgroup doesn't have a separator). |
css.tspanner |
The CSS style for the table spanner. |
css.tspanner.sep |
The line between different spanners. |
css.total |
The css of the total row if such is activated. |
css.cell |
The css.cell element allows you to add any possible CSS style to your table cells. See section below for details. |
css.cgroup |
The same as |
css.header |
The header style, not including the cgroup style |
css.header.border_bottom |
The header bottom-border style, e.g. |
css.class |
The html CSS class for the table. This allows directing html formatting through CSS directly at all instances of that class. Note: unfortunately the CSS is frequently ignored by word processors. This option is mostly inteded for web-presentations. |
css.table |
You can specify the the style of the table-element using this parameter |
pos.rowlabel |
Where the rowlabel should be positioned. This value can be |
pos.caption |
Set to |
col.rgroup |
Alternating colors (zebra striping/banded rows) for each |
col.columns |
Alternating colors for each column. |
padding.rgroup |
Generally two non-breakings spaces, i.e. |
padding.tspanner |
The table spanner is usually without padding but you may specify padding
similar to |
spacer.celltype |
When using cgroup the table headers are separated through a empty
HTML cell that is by default filled with |
spacer.css.cgroup.bottom.border |
Defaults to |
spacer.css |
If you want the spacer cells to share settings you can set it here |
spacer.content |
Defaults to |
An invisible list
with the new theme
The styles available are:
standard
: The traditional standard style used in htmlTable()
since the early days
Google docs
: A style that is optimized for copy-pasting into documents on Google drive. This
is geared towards minimal padding and margins so that the table is as dense as possible.
blank
: Just as the name suggests the style is completly empty in terms of CSS. Positions
for rowlabel and caption are set to bottom
as these cannot be blank.
You can also provide your own style. Each style should be a names vector, e.g. c(width = "100px", color = "red")
or just a real css string, width: 100px; color: red;
.
## Not run:
setHtmlTableTheme("Google", align = "r")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.