blob: 26cae55bdd7cd4255287ffd07b428a5f843115ee [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 Zhub1caa272018-04-14 14:19:46 -040010 border_left = FALSE, border_right = FALSE, width_min = NULL,
Hao Zhu907ddfe2018-04-23 15:19:09 -040011 width_max = NULL, extra_css = NULL, include_thead = FALSE)
Hao Zhubff01912017-05-23 18:05:00 -040012}
13\arguments{
Hao Zhu76281fe2017-07-03 19:33:09 -040014\item{kable_input}{Output of \code{knitr::kable()} with \code{format} specified}
Hao Zhubff01912017-05-23 18:05:00 -040015
Hao Zhu322de082017-09-11 19:25:29 -040016\item{column}{A numeric value or vector indicating which column(s) to be selected.}
Hao Zhubff01912017-05-23 18:05:00 -040017
18\item{width}{A character string telling HTML & LaTeX how wide the column
19needs to be, e.g. "10cm", "3in" or "30em".}
20
21\item{bold}{A T/F value to control whether the text of the selected column
22need to be bolded.}
23
24\item{italic}{A T/F value to control whether the text of the selected column
25need to be emphasized.}
Hao Zhu8f202992017-07-15 02:20:18 -040026
27\item{monospace}{A T/F value to control whether the text of the selected column
28need to be monospaced (verbatim)}
Hao Zhuec7ab922017-08-19 22:56:44 -040029
Hao Zhu53454f02018-01-14 16:29:10 -050030\item{underline}{A T/F value to control whether the text of the selected row
31need to be underlined}
32
33\item{strikeout}{A T/F value to control whether the text of the selected row
34need to be stricked out.}
35
Hao Zhu53e240f2017-09-04 20:04:29 -040036\item{color}{A character string for column text color. Here please pay
37attention to the differences in color codes between HTML and LaTeX.}
Hao Zhuec7ab922017-08-19 22:56:44 -040038
Hao Zhu53e240f2017-09-04 20:04:29 -040039\item{background}{A character string for column background color. Here please
40pay attention to the differences in color codes between HTML and LaTeX.}
41
42\item{border_left}{A logical variable indicating whether there should be a
43border line on the left of the selected column. In HTML, you can also pass
44in a character string for the CSS of the border line}
45
46\item{border_right}{A logical variable indicating whether there should be a
47border line on the right of the selected column. In HTML, you can also pass
48in a character string for the CSS of the border line}
Hao Zhub1de9672018-01-08 16:29:24 -050049
Hao Zhu6107f372018-05-21 00:23:26 -040050\item{width_min}{Only for HTML table. Normal column width will automatically
51collapse when the window cannot hold enough contents. With this \code{width_min},
52you can set up a column with a width that won't collapse even when the
53window is not wide enough.}
54
55\item{width_max}{Only for HTML table. \code{width_max} defines the maximum width
56of table columns.}
57
Hao Zhub1de9672018-01-08 16:29:24 -050058\item{extra_css}{Extra css text to be passed into the cells of the row. Note
59that it's not for the whole column but to each individual cells}
Hao Zhub1caa272018-04-14 14:19:46 -040060
Hao Zhu907ddfe2018-04-23 15:19:09 -040061\item{include_thead}{T/F. A HTML only feature to contoll whether the
62header row will be manipulated. Default is \code{FALSE}.}
Hao Zhubff01912017-05-23 18:05:00 -040063}
64\description{
65This function allows users to select a column and then specify
Hao Zhue7c8f702017-10-10 13:22:59 -040066its look.
Hao Zhubff01912017-05-23 18:05:00 -040067}
Hao Zhu78e61222017-05-24 20:53:35 -040068\examples{
69x <- knitr::kable(head(mtcars), "html")
Hao Zhu4840bc92017-09-15 15:55:05 -040070column_spec(x, 1:2, width = "20em", bold = TRUE, italic = TRUE)
Hao Zhu78e61222017-05-24 20:53:35 -040071
72}