### Bug description

Tables without a caption should not be numbered. In the following test document, the second table is captioned and is correctly numbered 1 with html output and incorrectly numbered 2 with pdf output. Rendered files are attached. Quarto version is 1.2.269. Linux version is Ubuntu 22.04.

````
---
title: test
format: pdf
##format: html
---

```{r, echo=FALSE, message=FALSE}
library(knitr )
opts_chunk$set(echo = FALSE
              ,message = FALSE)
library(gt)
library(tidyverse)
mt <- mtcars[1:4, 1:4]
```

```{r}
gt(mt)  ## does not display a number
```

```{r}
#| label: tbl-num
#| tbl-cap: 'here is a caption using chunk options'
mt %>%
    gt()  ## table number is 1 in html and 2 in pdf
```
Here is a cross-reference to  @tbl-num

```{r}
sessionInfo()
```
````

Rendered from command line; didn't use RStudio

[test_quarto.zip](https://github.com/quarto-dev/quarto-cli/files/10157208/test_quarto.zip)


### 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
2022-12-05T19:19:26Z
rmcd1024
bug
v1.3
closed
Table numbering inconsistent between html and pdf (incorrect in pdf)
https://github.com/quarto-dev/quarto-cli/issues/3571