### Bug description

(I'm not sure if it is a bug, or if I'm doing something wrong)

I'm trying to get a summary stats table in Quarto with CrossRef. For LaTeX it works perfectly. However in HTML it cannot recognice it and stays @tbl-stats. (See first example). If I add a div with id containing tbl- at the beginning (also tried tbl-stats, there is not difference) the CrossRef works, however below the table it writes "?(caption)" and in the HTML-Code it adds a new div around my div with the set id. (if I use tbl-stats in my div, it's repeated) The set caption itself is above the table.

Markdown-Text: @tbl-stat zeigt die daraus entstandene Tabelle.

````md
```{r}
#| results: asis
#| echo: false
#| tbl-cap: "Statistiktabelle"
#| label: tbl-stat

stargazer::stargazer(glm.predict::selects2015, header = FALSE, 
                     type = ifelse(knitr::is_latex_output(),"latex", "html"))
```
````

````md
```{r}
#| results: asis
#| echo: false
#| tbl-cap: "Statistiktabelle"
#| label: tbl-stat

if(knitr::is_html_output()){
  cat("<div id='tbl-'>")
}

stargazer::stargazer(glm.predict::selects2015, header = FALSE, 
                     type = ifelse(knitr::is_latex_output(),"latex", "html"))

if(knitr::is_html_output()){
  cat("</div>")
}
```
````

R Studio Version:
RStudio 2022.12.0+353 "Elsbeth Geranium" Release (7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36

OS: Windows 11 Pro, 22621.1265

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cscheid
2023-03-06T07:32:01Z
benjaminschlegel
enhancement crossref tables
v1.4
open
stargazer html CrossRef
https://github.com/quarto-dev/quarto-cli/issues/4637