kableExtra icon indicating copy to clipboard operation
kableExtra copied to clipboard

How to freeze the column(s)?

Open englianhu opened this issue 4 years ago • 2 comments

My question similar with https://stackoverflow.com/questions/63718614/freeze-the-first-row-and-column-in-kable-in-r, which is freeze first or few columns in a table.

library(dplyr)
library(kableExtra)

why <- c(1,2,3,4,5,6,7,8,9,10)
wont <- c(1,2,3,4,5,6,7,8,9,10)
these <- c(1,2,3,4,5,6,7,8,9,10)
headers <- c(1,2,3,4,5,6,7,8,9,10)
stay <- c(1,2,3,4,5,6,7,8,9,10)
fixed <- c(1,2,3,4,5,6,7,8,9,10)

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 = TRUE)

source : How to keep headers fixed in kableExtra

Just know how to freeze the header but not column(s)... do appreciate if you are willing to shade me a light

englianhu avatar Jan 25 '21 17:01 englianhu

https://github.com/haozhu233/kableExtra/issues/419#issuecomment-675814637

englianhu avatar Jan 25 '21 18:01 englianhu

@englianhu have you figured this out? Seems its still not possible right?

gfspiteri avatar Feb 11 '22 08:02 gfspiteri

Closing as duplicate of https://github.com/haozhu233/kableExtra/issues/419

vincentarelbundock avatar Dec 05 '23 21:12 vincentarelbundock