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

using 'opt_interactive()' causes problems with table caption and cross-references #1809

Open
6 tasks done
eml-35327 opened this issue Jul 19, 2024 · 0 comments
Open
6 tasks done
Assignees

Comments

@eml-35327
Copy link

Prework

Description

calling 'opt_interactive()' causes the table caption to no longer display and any cross-references to that table to stop working and be populated with '???'.

There are many existing issues relating to 'opt_interactive()' and loss of styling/formatting and possibly this is part of or closely related to those. However, I couldn't find any specific mention of problems or bugs involve dissapearing captions so thought it would be worth posting a new issue.

Reproducible example

  • Post a minimal reproducible example so the maintainer can troubleshoot the problems you identify. A reproducible example is:
    • Runnable: post enough R code and data so any onlooker can create the error on their own computer.
    • Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
    • Readable: format your code according to the tidyverse style guide.

Expected result

The following code creates a table with the expected caption and also successfully creates cross-references in a bookdown/markdown document:

#Example of table without interactive HTML working as intended 

library(dplyr)
 library(gt)
    
    iris %>%
      slice(1:20) %>% 
      gt(caption = "This is a table caption")

However, when adding interactive HTML options via 'opt_interactive()' as per the following code, the header no longer displays and any cross references are populated with '???':

#Example of table with interactive HTML that does not work as intended

 library(dplyr)
 library(gt)
    
  iris %>%
      slice(1:20) %>% 
      gt(caption = "This is a table caption") %>% 
      opt_interactive()
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