This is probably a simple one but the correct search terms are eluding me, how to set the column width to adjust to content for HTML tables in quarto? specifically, gt
tables.
In markdown, this was the default behavior but with quarto the table maximizes to take the full space, consider this simple example where you have a very small table.
---
title: "Test"
format:
html:
self-contained: true
knitr:
opts_chunk:
echo: false
warning: false
message: false
editor: visual
---
```{r}
#| tbl-colwidths: false
library(dplyr)
library(gt)
iris %>%
count(Species) %>%
gt()
```
When executed interactively the table renders small on the Visual Editor, but when rendered, the table expands to the full page layout width.