flextable icon indicating copy to clipboard operation
flextable copied to clipboard

Freeze the first row and the first column in HTML flextable

Open FloBlue opened this issue 3 years ago • 0 comments

Hello Is there a way to freeze the first row and ideally the first column of a large table in Rmarkdown to HTML? This option exists in Kableextra for the first row. That would be really great!

Thanks a lot for any help

  library(dplyr)
 library(kableExtra)
  library(flextable); library(knitr)

why <- c(1:20)
wont <- c(1:20)
these <- c(1:20)
headers <- c(1:20)
stay <- c(1:20)
fixed <- c(1:20)

table_data <- data.frame(why, wont, these, headers, stay, fixed)

         table_data %>% 
         kable( format = "html") %>% 
         kable_styling(position = "center", full_width = F, bootstrap_options = c("striped","hover"))%>%        
         scroll_box( width = "1000px", height = "200px", fixed_thead = T)
 
  knit_print(flextable(table_data))   

FloBlue avatar Sep 15 '22 08:09 FloBlue