% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/htmlTable_theme.R
\name{setHtmlTableTheme}
\alias{setHtmlTableTheme}
\title{Set or update theme for \code{\link[=htmlTable]{htmlTable()}}}
\usage{
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
)
}
\arguments{
\item{theme}{A \code{list} containing all the styles or a \code{string} that is matched to some of the preset style (See details
below in the \emph{Theme options} section). \emph{Note}: the full name of the theme is not required as they are matched
using \code{\link[base:match.arg]{base::match.arg()}}.}

\item{align}{A character strings specifying column alignments, defaulting to \code{'c'}
to center. Valid chars for alignments are l = left, c = center and r = right. You can also specify
\code{align='c|c'} and other LaTeX tabular formatting. If you want to set the alignment of the
rownames this string needst to be \code{ncol(x) + 1}, otherwise it automatically
pads the string with a left alignment for the rownames.}

\item{align.header}{A character strings specifying alignment for column header,
defaulting to centered, i.e. \verb{[paste][base::paste](rep('c',ncol(x)),collapse='')}.}

\item{align.cgroup}{The justification of the \code{cgroups}}

\item{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.}

\item{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).}

\item{css.tspanner}{The CSS style for the table spanner.}

\item{css.tspanner.sep}{The line between different spanners.}

\item{css.total}{The css of the total row if such is activated.}

\item{css.cell}{The css.cell element allows you to add any possible CSS style to your
table cells. See section below for details.}

\item{css.cgroup}{The same as \code{css.class} but for cgroup formatting.}

\item{css.header}{The header style, not including the cgroup style}

\item{css.header.border_bottom}{The header bottom-border style, e.g. \verb{border-bottom: 1px solid grey}}

\item{css.class}{The html CSS class for the table. This allows directing html
formatting through \href{https://www.w3schools.com/Css/}{CSS}
directly at all instances of that class. \emph{Note:} unfortunately the
CSS is frequently ignored by word processors. This option
is mostly inteded for web-presentations.}

\item{css.table}{You can specify the the style of the table-element using this parameter}

\item{pos.rowlabel}{Where the rowlabel should be positioned. This value can be \code{"top"},
\code{"bottom"}, \code{"header"}, or a integer between \code{1} and \code{nrow(cgroup) + 1}. The options
\code{"bottom"} and \code{"header"} are the same, where the row label is presented at the same level as
the header.}

\item{pos.caption}{Set to \code{"bottom"} to position a caption below the table
instead of the default of \code{"top"}.}

\item{col.rgroup}{Alternating colors (zebra striping/banded rows) for each \code{rgroup}; one or two colors
is recommended and will be recycled.}

\item{col.columns}{Alternating colors for each column.}

\item{padding.rgroup}{Generally two non-breakings spaces, i.e. \verb{&nbsp;&nbsp;}, but some
journals only have a bold face for the rgroup and leaves the subelements unindented.}

\item{padding.tspanner}{The table spanner is usually without padding but you may specify padding
similar to \code{padding.rgroup} and it will be added to all elements, including the rgroup elements.
This allows for a 3-level hierarchy if needed.}

\item{spacer.celltype}{When using cgroup the table headers are separated through a empty
HTML cell that is by default filled with \verb{&nbsp;} (no-breaking-space) that prevents the cell
from collapsing. The purpose of this is to prevent the headers underline to bleed into one
as the underline is for the entire cell. You can alter this behavior by changing this option,
valid options are \code{single_empty}, \code{skip}, \code{double_cell}. The \code{single_empty} is the default,
the \code{skip} lets the header bleed into one and skips entirely, \code{double_cell} is for having
two cells so that a vertical border ends up centered (specified using the \code{align} option).
The arguments are matched internally using \link[base:match.arg]{base::match.arg} so you can specify only a part
of the name, e.g. \code{"sk"} will match \code{"skip"}.}

\item{spacer.css.cgroup.bottom.border}{Defaults to \code{none} and used for separating cgroup headers.
Due to a browser bug this is sometimes ignored and you may therefore need to set this
to \verb{1px solid white} to enforce a white border.}

\item{spacer.css}{If you want the spacer cells to share settings you can set it here}

\item{spacer.content}{Defaults to \verb{&nbsp;} as this guarantees that the cell is not collapsed
and is highly compatible when copy-pasting to word processors.}
}
\value{
An invisible \code{list} with the new theme
}
\description{
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 \code{\link[=addHtmlTableStyle]{addHtmlTableStyle()}}.
}
\section{Theme options}{


The styles available are:
\itemize{
\item \code{standard}: The traditional standard style used in \code{\link[=htmlTable]{htmlTable()}} since the early days
\item \verb{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.
\item \code{blank}: Just as the name suggests the style is completly empty in terms of CSS. Positions
for rowlabel and caption are set to \code{bottom} as these cannot be blank.
}

You can also provide your own style. Each style should be a names vector, e.g. \code{c(width = "100px", color = "red")}
or just a real css string, \verb{width: 100px; color: red;}.
}

\examples{
\dontrun{
setHtmlTableTheme("Google", align = "r")
}
}
