Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cols_width() modifying the last column makes table disappear in Quarto document with format: revealjs #1622

Open
2 tasks done
mine-cetinkaya-rundel opened this issue Apr 16, 2024 · 0 comments
Assignees

Comments

@mine-cetinkaya-rundel
Copy link

Prework

Description

Modifying the width of the last column, either explicitly or with everything() as the last argument, makes the whole table disappear when format: revealjs.

Reproducible example

Create a document with format: html and add the following content:

---
format: html
---

```{r}
#| message: false
library(gt)
library(dplyr)
```

```{r}
mtcars |>
  select(mpg, cyl, disp) |>
  slice_head(n = 5) |>
  gt() |>
  cols_width(
    mpg ~ px(200),
    everything() ~ px(200)
  )
```

Table is there.

Screenshot 2024-04-16 at 12 15 17 AM

Now change the format to revealjs.

Table disappears in the output.

Screenshot 2024-04-16 at 12 16 43 AM

Explicitly defining widths for all but the last column, the table is back:

mtcars |>
  select(mpg, cyl, disp) |>
  slice_head(n = 5) |>
  gt() |>
  cols_width(
    mpg ~ px(200),
    cyl ~ px(20)
  )
Screenshot 2024-04-16 at 12 18 33 AM

Define width for the last column, and the table is gone again:

mtcars |>
  select(mpg, cyl, disp) |>
  slice_head(n = 5) |>
  gt() |>
  cols_width(
    mpg ~ px(200),
    cyl ~ px(20),
    disp ~ px(100)
  )
Screenshot 2024-04-16 at 12 23 01 AM

As an aside, the cols_width() function doesn't seem to do anything in any of the steps, but that's likely a separate issue.

Expected result

Table should have appeared with each step.

Session info

R version 4.3.3 (2024-02-29)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_2.4.5     usethis_2.2.3.9000

loaded via a namespace (and not attached):
 [1] miniUI_0.1.1.1    compiler_4.3.3    crayon_1.5.2      promises_1.2.1    Rcpp_1.0.12      
 [6] stringr_1.5.1     callr_3.7.3       later_1.3.1       fastmap_1.1.1     mime_0.12        
[11] R6_2.5.1          knitr_1.45        htmlwidgets_1.6.4 profvis_0.3.8     shiny_1.8.1.1    
[16] rlang_1.1.3       cachem_1.0.8      stringi_1.8.3     xfun_0.43         httpuv_1.6.12    
[21] fs_1.6.3          pkgload_1.3.3     memoise_2.0.1     cli_3.6.2         magrittr_2.0.3   
[26] ps_1.7.5          digest_0.6.35     processx_3.8.2    rstudioapi_0.15.0 xtable_1.8-4     
[31] remotes_2.4.2.1   lifecycle_1.0.4   prettyunits_1.2.0 vctrs_0.6.5       glue_1.7.0       
[36] urlchecker_1.0.1  sessioninfo_1.2.2 rsconnect_1.1.1   pkgbuild_1.4.2    purrr_1.0.2      
[41] tools_4.3.3       ellipsis_0.3.2    htmltools_0.5.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants