Make kable table not full width in Quarto

I just started trying out Quarto. I am adding a table in an html document and I do not want it to extend over the whole width of the page. The following code (using package kableExtra) works for an html document rendered in RMarkdown, as per Create Awesome HTML Table with knitr::kable and kableExtra

DE3 <- data.frame(q_text = c("Female", "Male"),
                  cnt = c(20,17),
                  percentage = c(54.1, 45.9))

DE3 %>% kable(col.names = c("What is your gender?", "Count", "Percentage")) %>% 
  kable_paper(bootstrap_options = "striped", full_width = FALSE)

However, in Quarto the table remains full width (no warnings or error messages). I have searched the Quarto documentation but could not find anything on this topic.

See this discussion Quarto issue with kableExtra::kable_styling · Issue #5737 · quarto-dev/quarto-cli · GitHub

and Quarto - Tables

Quarto has a special processing for table with specific theme, and if you want to keep a specific processing for a package, you need to opt out quarto processing.

1 Like

This topic was automatically closed 7 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.