1

我尝试将带有图像的 gt 表保存为 html,并且省略了图像。我错过了什么吗?

来自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"
  )
'''
4

1 回答 1

1

图像包含在 html 中,如果inline_css = FALSE

于 2020-08-07T03:50:22.553 回答