Skip to content

Table captions don't work with html widgets (e.g. DT, reactable) #6838

@half-normal

Description

@half-normal

Bug description

Maybe this should be a feature request as I imagine it is known functionality, but it would be nice to have table captions work for html widgets. For example the reactablefmtr is a nice package for making interactive tables, but currently I have to use figure captions.

Steps to reproduce

## Test

```{r echo=FALSE}
#| label: tbl-DT
#| tbl-cap: "A table made with DT"
library(DT)
df <- data.frame(x = 1:2, y = c("A", "B"))
df |> datatable()
```

```{r echo=FALSE}
#| label: tbl-reactable
#| tbl-cap: "A table made with reactablefmtr"
library(reactablefmtr)
df |> reactable(theme = clean())
```

See @tbl-DT and @tbl-reactable for ...

image

Expected behavior

Table captions render.

Actual behavior

Table captions do not render.

Your environment

   sysname        release        version            machine    
   "Windows"    "10 x64"  "build 19045"      "x86-64" 

   quarto --version
   1.3.361
   
  R version 4.3.1 (2023-06-16 ucrt) -- "Beagle Scouts"
  Platform: x86_64-w64-mingw32/x64 (64-bit)

Quarto check output

[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.3.361
Path: C:\Users\bford\AppData\Local\Programs\Quarto\bin
CodePage: 65001

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
Version: 3.10.10 (Conda)
Path: C:/Users/bford/AppData/Local/Programs/mambaforge/python.exe
Jupyter: 5.3.1
Kernels: python3

[>] Checking Jupyter engine render....OK

(-) Checking R installation...........── Attaching core tidyverse
packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.2 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ ggplot2 3.4.2 ✔ tibble 3.2.1
✔ lubridate 1.9.2 ✔ tidyr 1.3.0
✔ purrr 1.0.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ ::() masks
ℹ Use the conflicted package (http://conflicted.r-lib.org/) to force all conflicts to become errors
[>] Checking R installation...........OK
Version: 4.3.1
Path: C:/Users/bford/AppData/Local/Programs/R/R-4.3.1
LibPaths:
- C:/Users/bford/AppData/Local/Programs/R/R-4.3.1/library
knitr: 1.43
rmarkdown: 2.22

[>] Checking Knitr engine render......OK

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcrossreftablesIssues with Tables including the gt integrationtriaged-toIssues that were not self-assigned, signals that an issue was assigned to someone.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions