I would like to block the first row AND the first column in a Kable
or flextable
table on a Rmardown file for html. The subject has already been discussed on SO but there is no answer. I don't want to use the DT package.
Maybe there would be a way to adapt the scroll_box
function (kableExtra
package)? Or to modify the concerned cells? I don't have HTML skills to do this.
Thank you in advance for your help!
The creator of the flextable
package added this option for html reports.
This does not exist on the kableEtra
package or any other package as far as I know.
library(flextable)
dat <- lapply(1:30, function(x) rnorm(n = 50)) %>%
setNames(paste0("colname", 1:30)) %>%
as.data.frame()
ft_1 <- flextable(dat)
ft_1 <- set_table_properties(ft_1,
opts_html = list(
extra_css = ".tabwid tbody tr > :first-child {position: sticky;z-index: 1;left: 0;background: #ddd;}",
scroll = list(height="500px")))
ft_1