Maksym
Maksym

Reputation: 41

Saving gt table with images as html

I try to save gt table with images as html and images are omitted. Did I miss anything?

Example from https://gt.rstudio.com/index.html

tab_1 <-
  dplyr::tibble(
    pixels = px(seq(10, 35, 5)),
    image = seq(10, 35, 5)
  ) %>%
  gt() %>%
  text_transform(
    locations = cells_body(vars(image)),
    fn = function(x) {
      local_image(
        filename = test_image(type = "png"),
        height = as.numeric(x)
      )
    }
  )

# images are in preview
tab_1

# images empty cells
tab_1 %>%
  gtsave(
    "tab_1.html", inline_css = TRUE,
    path = "../html"
  )
'''

Upvotes: 1

Views: 583

Answers (1)

Maksym
Maksym

Reputation: 41

Images are included in html if inline_css = FALSE

Upvotes: 1

Related Questions