blob: 5d4b3af5d029834698d0ceeb4201fb9d2cc1f18d [file] [log] [blame]
Hao Zhu501fb452017-07-05 14:37:13 -04001% 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 Zhu4b0c51e2017-08-01 15:21:07 -04007scroll_box(kable_input, height = NULL, width = NULL,
Hao Zhu270846b2019-01-06 17:52:26 -05008 box_css = "border: 1px solid #ddd; padding: 5px; ", extra_css = NULL,
Hao Zhu72917f92019-03-15 18:41:42 -04009 fixed_thead = TRUE)
Hao Zhu501fb452017-07-05 14:37:13 -040010}
11\arguments{
12\item{kable_input}{A HTML kable object}
13
14\item{height}{A character string indicating the height of the box, e.g. "50px"}
15
16\item{width}{A character string indicating the width of the box, e.g. "100px"}
Hao Zhu4b0c51e2017-08-01 15:21:07 -040017
18\item{box_css}{CSS text for the box}
19
20\item{extra_css}{Extra CSS styles}
Hao Zhu270846b2019-01-06 17:52:26 -050021
Hao Zhu72917f92019-03-15 18:41:42 -040022\item{fixed_thead}{HTML table option so table header row is fixed at top.
23Values can be either T/F or \code{list(enabled = T/F, background = "anycolor")}.}
Hao Zhu501fb452017-07-05 14:37:13 -040024}
25\description{
26This function will put a HTML kable object in a fixed-height,
27fixed-width or both box and make it scrollable.
28}
Irene319a5462018-04-17 15:37:39 -070029\examples{
30\dontrun{
31# Specify table size by pixels
32kable(cbind(mtcars, mtcars), "html") \%>\%
33 kable_styling() \%>\%
34 scroll_box(width = "500px", height = "200px")
35
36# Specify by percent
37kable(cbind(mtcars, mtcars), "html") \%>\%
38 kable_styling() \%>\%
39 scroll_box(width = "100\%", height = "200px")
40}
41}