Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/cell_spec.R |
| 3 | \name{cell_spec} |
| 4 | \alias{cell_spec} |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 5 | \alias{text_spec} |
| 6 | \title{Specify Cell/Text format} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 7 | \usage{ |
Hao Zhu | 9410a27 | 2020-08-03 01:11:47 -0400 | [diff] [blame] | 8 | cell_spec( |
| 9 | x, |
| 10 | format, |
| 11 | bold = FALSE, |
| 12 | italic = FALSE, |
| 13 | monospace = FALSE, |
| 14 | underline = FALSE, |
| 15 | strikeout = FALSE, |
| 16 | color = NULL, |
| 17 | background = NULL, |
| 18 | align = NULL, |
| 19 | font_size = NULL, |
| 20 | angle = NULL, |
| 21 | tooltip = NULL, |
| 22 | popover = NULL, |
| 23 | link = NULL, |
Hao Zhu | dcbdff6 | 2020-08-10 13:29:53 -0400 | [diff] [blame^] | 24 | new_tab = FALSE, |
Hao Zhu | 9410a27 | 2020-08-03 01:11:47 -0400 | [diff] [blame] | 25 | extra_css = NULL, |
| 26 | escape = TRUE, |
| 27 | background_as_tile = TRUE, |
| 28 | latex_background_in_cell = TRUE |
| 29 | ) |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 30 | |
Hao Zhu | 9410a27 | 2020-08-03 01:11:47 -0400 | [diff] [blame] | 31 | text_spec( |
| 32 | x, |
| 33 | format, |
| 34 | bold = FALSE, |
| 35 | italic = FALSE, |
| 36 | monospace = FALSE, |
| 37 | underline = FALSE, |
| 38 | strikeout = FALSE, |
| 39 | color = NULL, |
| 40 | background = NULL, |
| 41 | align = NULL, |
| 42 | font_size = NULL, |
| 43 | angle = NULL, |
| 44 | tooltip = NULL, |
| 45 | popover = NULL, |
| 46 | link = NULL, |
Hao Zhu | dcbdff6 | 2020-08-10 13:29:53 -0400 | [diff] [blame^] | 47 | new_tab = FALSE, |
Hao Zhu | 9410a27 | 2020-08-03 01:11:47 -0400 | [diff] [blame] | 48 | extra_css = NULL, |
| 49 | escape = TRUE, |
| 50 | background_as_tile = TRUE, |
| 51 | latex_background_in_cell = FALSE |
| 52 | ) |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 53 | } |
| 54 | \arguments{ |
| 55 | \item{x}{Things to be formated. It could be a vector of numbers or strings.} |
| 56 | |
| 57 | \item{format}{Either "html" or "latex". It can also be set through |
| 58 | \code{option(knitr.table.format)}, same as \code{knitr::kable()}.} |
| 59 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 60 | \item{bold}{T/F for font bold.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 61 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 62 | \item{italic}{T/F for font italic.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 63 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 64 | \item{monospace}{T/F for font monospaced (verbatim)} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 65 | |
Hao Zhu | 53454f0 | 2018-01-14 16:29:10 -0500 | [diff] [blame] | 66 | \item{underline}{A T/F value to control whether the text of the selected row |
| 67 | need to be underlined} |
| 68 | |
| 69 | \item{strikeout}{A T/F value to control whether the text of the selected row |
| 70 | need to be stricked out.} |
| 71 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 72 | \item{color}{A character string for text color. Here please pay |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 73 | attention to the differences in color codes between HTML and LaTeX.} |
| 74 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 75 | \item{background}{A character string for background color. Here please |
| 76 | pay attention to the differences in color codes between HTML and LaTeX. Also |
| 77 | note that in HTML, background defined in cell_spec won't cover the whole |
| 78 | cell.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 79 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 80 | \item{align}{A character string for cell alignment. For HTML, possible |
| 81 | values could be \code{l}, \code{c}, \code{r} plus \code{left}, \code{center}, \code{right}, \code{justify}, |
| 82 | \code{initial} and \code{inherit} while for LaTeX, you can only choose |
| 83 | from \code{l}, \code{c} & \code{r}.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 84 | |
Hao Zhu | 6f362bb | 2017-10-23 23:21:38 -0400 | [diff] [blame] | 85 | \item{font_size}{A numeric input for font size. For HTML, you can also use |
Hao Zhu | 8b32b19 | 2017-10-24 14:51:48 -0400 | [diff] [blame] | 86 | options including \code{xx-small}, \code{x-small}, \code{small}, \code{medium}, \code{large}, |
| 87 | \code{x-large}, \code{xx-large}, \code{smaller}, \code{larger}, \code{initial} and \code{inherit}.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 88 | |
Hao Zhu | 9ce317e | 2017-10-12 18:19:55 -0400 | [diff] [blame] | 89 | \item{angle}{0-360, degree that the text will rotate. Can be a vector.} |
| 90 | |
Hao Zhu | 064990d | 2017-10-17 18:08:42 -0400 | [diff] [blame] | 91 | \item{tooltip}{A vector of strings to be displayed as tooltip. |
Hao Zhu | 6f362bb | 2017-10-23 23:21:38 -0400 | [diff] [blame] | 92 | Obviously, this feature is only available in HTML. Read the package |
| 93 | vignette to see how to use bootstrap tooltip css to improve the loading |
| 94 | speed and look.} |
| 95 | |
| 96 | \item{popover}{Similar with tooltip but can hold more contents. The best way |
| 97 | to build a popover is through \code{spec_popover()}. If you only provide a text |
| 98 | string, it will be used as content. Note that You have to enable this |
| 99 | bootstrap module manually. Read the package vignette to see how.} |
| 100 | |
| 101 | \item{link}{A vector of strings for url links. Can be used together with |
| 102 | tooltip and popover.} |
| 103 | |
Hao Zhu | dcbdff6 | 2020-08-10 13:29:53 -0400 | [diff] [blame^] | 104 | \item{new_tab}{T/F for whether to open up the new link in new tab.} |
| 105 | |
Hao Zhu | b1de967 | 2018-01-08 16:29:24 -0500 | [diff] [blame] | 106 | \item{extra_css}{Extra css text to be passed into the cell} |
| 107 | |
Hao Zhu | 6f362bb | 2017-10-23 23:21:38 -0400 | [diff] [blame] | 108 | \item{escape}{T/F value showing whether special characters should be escaped.} |
Hao Zhu | 457acb4 | 2017-10-14 17:37:02 -0400 | [diff] [blame] | 109 | |
| 110 | \item{background_as_tile}{T/F value indicating if you want to have round |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 111 | cornered tile as background in HTML.} |
| 112 | |
| 113 | \item{latex_background_in_cell}{T/F value. It only takes effect in LaTeX |
| 114 | when \code{background} provided, Default value is \code{TRUE}. If it's \code{TRUE}, the |
| 115 | background only works in a table cell. If it's \code{FALSE}, it works outside of a |
| 116 | table environment.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 117 | } |
| 118 | \description{ |
| 119 | Specify Cell format before it gets into kable |
| 120 | } |