Put a HTML table into a scrollable box
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. "50px" |
width |
A character string indicating the width of the box, e.g. "100px" |
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.