blob: 27f8de2488e11d0f801e8a9db62ab444f98a52b6 [file] [log] [blame]
Hao Zhubff01912017-05-23 18:05:00 -04001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/column_spec.R
3\name{column_spec}
4\alias{column_spec}
5\title{Specify the look of the selected column}
6\usage{
Hao Zhu78e61222017-05-24 20:53:35 -04007column_spec(kable_input, column, width = NULL, bold = FALSE,
Hao Zhu53454f02018-01-14 16:29:10 -05008 italic = FALSE, monospace = FALSE, underline = FALSE,
9 strikeout = FALSE, color = NULL, background = NULL,
Hao Zhub1de9672018-01-08 16:29:24 -050010 border_left = FALSE, border_right = FALSE, extra_css = NULL)
Hao Zhubff01912017-05-23 18:05:00 -040011}
12\arguments{
Hao Zhu76281fe2017-07-03 19:33:09 -040013\item{kable_input}{Output of \code{knitr::kable()} with \code{format} specified}
Hao Zhubff01912017-05-23 18:05:00 -040014
Hao Zhu322de082017-09-11 19:25:29 -040015\item{column}{A numeric value or vector indicating which column(s) to be selected.}
Hao Zhubff01912017-05-23 18:05:00 -040016
17\item{width}{A character string telling HTML & LaTeX how wide the column
18needs to be, e.g. "10cm", "3in" or "30em".}
19
20\item{bold}{A T/F value to control whether the text of the selected column
21need to be bolded.}
22
23\item{italic}{A T/F value to control whether the text of the selected column
24need to be emphasized.}
Hao Zhu8f202992017-07-15 02:20:18 -040025
26\item{monospace}{A T/F value to control whether the text of the selected column
27need to be monospaced (verbatim)}
Hao Zhuec7ab922017-08-19 22:56:44 -040028
Hao Zhu53454f02018-01-14 16:29:10 -050029\item{underline}{A T/F value to control whether the text of the selected row
30need to be underlined}
31
32\item{strikeout}{A T/F value to control whether the text of the selected row
33need to be stricked out.}
34
Hao Zhu53e240f2017-09-04 20:04:29 -040035\item{color}{A character string for column text color. Here please pay
36attention to the differences in color codes between HTML and LaTeX.}
Hao Zhuec7ab922017-08-19 22:56:44 -040037
Hao Zhu53e240f2017-09-04 20:04:29 -040038\item{background}{A character string for column background color. Here please
39pay attention to the differences in color codes between HTML and LaTeX.}
40
41\item{border_left}{A logical variable indicating whether there should be a
42border line on the left of the selected column. In HTML, you can also pass
43in a character string for the CSS of the border line}
44
45\item{border_right}{A logical variable indicating whether there should be a
46border line on the right of the selected column. In HTML, you can also pass
47in a character string for the CSS of the border line}
Hao Zhub1de9672018-01-08 16:29:24 -050048
49\item{extra_css}{Extra css text to be passed into the cells of the row. Note
50that it's not for the whole column but to each individual cells}
Hao Zhubff01912017-05-23 18:05:00 -040051}
52\description{
53This function allows users to select a column and then specify
Hao Zhue7c8f702017-10-10 13:22:59 -040054its look.
Hao Zhubff01912017-05-23 18:05:00 -040055}
Hao Zhu78e61222017-05-24 20:53:35 -040056\examples{
57x <- knitr::kable(head(mtcars), "html")
Hao Zhu4840bc92017-09-15 15:55:05 -040058column_spec(x, 1:2, width = "20em", bold = TRUE, italic = TRUE)
Hao Zhu78e61222017-05-24 20:53:35 -040059
60}