### Bug description

Hi, and thanks for a highly usable tool; quarto.

I have a couple of related issues with a table made by `kableExtra::kbl()` and `kableExtra::kable_styling()` which spans multiple pages in the resulting pdf.

### First issue
 
When I render the pdf in quarto with a label `#| label: tbl-longTable` the table are cut on the first page. 

If I instead remove the label the whole table is rendered spanning multiple pages but of course the cross reference in the text does not work.

### Second issue

If I use a `#| tbl-cap: ` for the same table I get following error while rendering the report.

``````
Package array Error:  Illegal pream-token (\caption): `c' used.

``````

However, if I do not have the label the table is generated but without caption.

Also with the lable the R-code is not showing in the pdf. 

I have traced the issues to when you add the `column_spec()`, without them the table renders fine with both *label:* and *tbl-cap:*.
Everything does work with the `row_spec()` however.

Any Ideas of how to proceed?

--------------

**R-studio**

```
RStudio 2022.12.0+353 "Elsbeth Geranium"
Release (7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
rstudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36
```


**Linux**

`Linux Mint 21.1, kernel 5.15.0-67-generic`


**Quarto**
`quarto 1.2.335`

------------------------

### A .qmd with example code

Below is a reprex with the YAML and R-code which reproduce my error on my system.

````
---
title: "reprex_kable"
format: pdf
documentclass: scrreprt
execute: 
  warning: false
  error: false
  message: false
---

The table @tbl-cars should be a table spaning more than one page, with a caption.


```{r}
#| label: tbl-cars
#| echo: false
#| cache: true
#| tbl-cap: "A table with many models repeating itself"

library(tidyverse)
library(kableExtra)

mtcars %>% 
  bind_rows(mtcars, mtcars) %>% 
  kableExtra::kbl(booktabs = T, longtable = T) %>% 
  kableExtra::kable_styling(latex_options = c("hold_position", "striped"), full_width = F, repeat_header_continued = T, repeat_header_text = "Continuation table:") %>% 
  column_spec(column = 1:2, width = "4cm") %>%
  column_spec(column = 1, bold = T) %>%
  row_spec(row = 0, bold = T, background = "#3e77c1", font_size = 12, color = "white", hline_after = F) %>%
  row_spec(1:107, hline_after = T, font_size = 10)

```
````


### 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-10T12:25:57Z
ScientiaFelis
bug tables
v1.3
closed
Long-table cannot have a cross-referenced label or tbl-cap when using kableExtra col_spec
https://github.com/quarto-dev/quarto-cli/issues/4748