Hao Zhu | 501fb45 | 2017-07-05 14:37:13 -0400 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/scroll_box.R |
| 3 | \name{scroll_box} |
| 4 | \alias{scroll_box} |
| 5 | \title{Put a HTML table into a scrollable box} |
| 6 | \usage{ |
Hao Zhu | 9410a27 | 2020-08-03 01:11:47 -0400 | [diff] [blame] | 7 | scroll_box( |
| 8 | kable_input, |
| 9 | height = NULL, |
| 10 | width = NULL, |
| 11 | box_css = "border: 1px solid #ddd; padding: 5px; ", |
| 12 | extra_css = NULL, |
| 13 | fixed_thead = TRUE |
| 14 | ) |
Hao Zhu | 501fb45 | 2017-07-05 14:37:13 -0400 | [diff] [blame] | 15 | } |
| 16 | \arguments{ |
| 17 | \item{kable_input}{A HTML kable object} |
| 18 | |
| 19 | \item{height}{A character string indicating the height of the box, e.g. "50px"} |
| 20 | |
| 21 | \item{width}{A character string indicating the width of the box, e.g. "100px"} |
Hao Zhu | 4b0c51e | 2017-08-01 15:21:07 -0400 | [diff] [blame] | 22 | |
| 23 | \item{box_css}{CSS text for the box} |
| 24 | |
| 25 | \item{extra_css}{Extra CSS styles} |
Hao Zhu | 270846b | 2019-01-06 17:52:26 -0500 | [diff] [blame] | 26 | |
Hao Zhu | 72917f9 | 2019-03-15 18:41:42 -0400 | [diff] [blame] | 27 | \item{fixed_thead}{HTML table option so table header row is fixed at top. |
| 28 | Values can be either T/F or \code{list(enabled = T/F, background = "anycolor")}.} |
Hao Zhu | 501fb45 | 2017-07-05 14:37:13 -0400 | [diff] [blame] | 29 | } |
| 30 | \description{ |
| 31 | This function will put a HTML kable object in a fixed-height, |
| 32 | fixed-width or both box and make it scrollable. |
| 33 | } |
Irene | 319a546 | 2018-04-17 15:37:39 -0700 | [diff] [blame] | 34 | \examples{ |
| 35 | \dontrun{ |
| 36 | # Specify table size by pixels |
| 37 | kable(cbind(mtcars, mtcars), "html") \%>\% |
| 38 | kable_styling() \%>\% |
| 39 | scroll_box(width = "500px", height = "200px") |
| 40 | |
| 41 | # Specify by percent |
| 42 | kable(cbind(mtcars, mtcars), "html") \%>\% |
| 43 | kable_styling() \%>\% |
| 44 | scroll_box(width = "100\%", height = "200px") |
| 45 | } |
| 46 | } |