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 | 4b0c51e | 2017-08-01 15:21:07 -0400 | [diff] [blame] | 7 | scroll_box(kable_input, height = NULL, width = NULL, |
| 8 | box_css = "border: 1px solid #ddd; padding: 5px; ", extra_css = NULL) |
Hao Zhu | 501fb45 | 2017-07-05 14:37:13 -0400 | [diff] [blame] | 9 | } |
| 10 | \arguments{ |
| 11 | \item{kable_input}{A HTML kable object} |
| 12 | |
| 13 | \item{height}{A character string indicating the height of the box, e.g. "50px"} |
| 14 | |
| 15 | \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] | 16 | |
| 17 | \item{box_css}{CSS text for the box} |
| 18 | |
| 19 | \item{extra_css}{Extra CSS styles} |
Hao Zhu | 501fb45 | 2017-07-05 14:37:13 -0400 | [diff] [blame] | 20 | } |
| 21 | \description{ |
| 22 | This function will put a HTML kable object in a fixed-height, |
| 23 | fixed-width or both box and make it scrollable. |
| 24 | } |
Irene | 319a546 | 2018-04-17 15:37:39 -0700 | [diff] [blame^] | 25 | \examples{ |
| 26 | \dontrun{ |
| 27 | # Specify table size by pixels |
| 28 | kable(cbind(mtcars, mtcars), "html") \%>\% |
| 29 | kable_styling() \%>\% |
| 30 | scroll_box(width = "500px", height = "200px") |
| 31 | |
| 32 | # Specify by percent |
| 33 | kable(cbind(mtcars, mtcars), "html") \%>\% |
| 34 | kable_styling() \%>\% |
| 35 | scroll_box(width = "100\%", height = "200px") |
| 36 | } |
| 37 | } |