It seems that `quarto` wants tables to be the way `kable` makes them (piped/markdown style), not the JS chunks produced by, say, `DT::datatable`.

`datatable` produces output, but captions and cross-referencing are ignored.

Small example:

```
    ---
    title: "test"
    format: html
    execute:
      echo: false
    ---

    ```{r}
    library(knitr)
    library(DT)
    d <- iris[1:20,]
    ```

    # kable
    @tbl-kable comes here.

    ```{r}
    #| tbl-cap: "kable {#tbl-kable}"
    kable(d)
    ```

    # DT::datatable
    @tbl-datatable comes here.

    ```{r}
    #| tab-cap: "datatable {#tbl-datatable}"
    datatable(d)
    ```

```

Unexpected output in final html is shown in attached screenshot.

Many thanks for looking into this. 

## Sys info:

```
MacBook-Pro-4:results jackman$ quarto check

[✓] Checking Quarto installation......OK
      Version: 0.9.528
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.10
      Path: /usr/local/bin/python3
      Jupyter: 4.10.0
      Kernels: julia-0.6, python3

(-) Checking Jupyter engine render....2022-06-07 14:10:55,569 - traitlets - WARNING - Kernel Provisioning: The 'local-provisioner' is not found.  This is likely due to the presence of multiple jupyter_client distributions and a previous distribution is being used as the source for entrypoints - which does not include 'local-provisioner'.  That distribution should be removed such that only the version-appropriate distribution remains (version >= 7).  Until then, a 'local-provisioner' entrypoint will be automatically constructed and used.
The candidate distribution locations are: ['/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/jupyter_client-7.3.2.dist-info']
[✓] Checking Jupyter engine render....OK

(/) Checking R installation...........Loadi
<img width="1001" alt="Screen Shot 2022-06-07 at 2 25 14 pm" src="https://user-images.githubusercontent.com/963653/172295722-9a0b57b8-8ef7-4a92-bcca-2258acb9bc9c.png">
ng .Rprofile for the current workflowr project
This is workflowr version 1.7.0
Run ?workflowr for help getting started
[✓] Checking R installation...........OK
      Version: 4.3.0
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/jackman/Library/R/arm64/4.3/library
        - /Library/Frameworks/R.framework/Versions/4.3/Resources/library
      rmarkdown: 2.14

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

```
<img width="1001" alt="Screen Shot 2022-06-07 at 2 25 14 pm" src="https://user-images.githubusercontent.com/963653/172295846-4d713479-b0e8-4683-b085-17dad61548ca.png">


cscheid
2022-06-07T04:27:11Z
simonjackman
enhancement crossref tables triaged-to
v1.4
open
DT::datatable cross-referencing and captions 
https://github.com/quarto-dev/quarto-cli/issues/1084