gt table not appear in for loop function after render to word

im trying to render a gt table into word file using quarto. but the result does not appear as a table. is there any way to fix this? below is my code and screenshot of word output

tbl_smry <- function(factor_ = 'manufacturer'){
  mpg %>% 
    rename(factor = factor_) %>% 
    group_by(year, factor) %>% 
    count() %>% 
    ungroup() %>% 
    gt()
  
}



for (x in c('manufacturer', 'model')) {
  tbl_smry(factor_ = x) %>% 
    print()
}

i put results='asis' for that chunk

Hi @malakmal ,

Could say a little about why you need to use a loop?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.