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