scroll_box | R Documentation |
This function will put a HTML kable object in a fixed-height, fixed-width or both box and make it scrollable.
scroll_box(
kable_input,
height = NULL,
width = NULL,
box_css = "border: 1px solid #ddd; padding: 5px; ",
extra_css = NULL,
fixed_thead = TRUE
)
kable_input |
A HTML kable object |
height |
A character string indicating the height of the box, e.g. |
width |
A character string indicating the width of the box, e.g. |
box_css |
CSS text for the box |
extra_css |
Extra CSS styles |
fixed_thead |
HTML table option so table header row is fixed at top.
Values can be either T/F or |
## Not run:
# 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.