Can gt collapse rows like kableExtra::collapse_rows?

I like the gt package with its many functionalities, but I can't find a way to collapse rows like it is possible to do in the kableExtra package.

Is is possible to the below, but using gt?


table <- tibble(
  X = c("A", "A", "A", "A", "B", "B", "B", "B"),
  Y = c("C", "C", "D", "D", "E", "E", "F", "F"),
  z = rnorm(8))

table %>% 
  kable() %>% 
  kable_styling() %>% 
  collapse_rows(columns = c(1, 2))