首页 > 解决方案 > 从R中的flextable中的超链接单元格中删除下划线

问题描述

我正在使用flextableandofficer将带有超链接单元格的表格写入 PowerPoint 幻灯片,但我不知道如何删除 URL 中的下划线。这是我的代码:

library(officer)
library(flextable)
library(magrittr)

# Make the table
no_ul <- fp_text(underlined = FALSE)
ft <- data.frame(x = "Hello", link = "www.google.com") %>%
  flextable(col_keys = "x") %>%
  compose(j = 1, 
          value = as_paragraph(hyperlink_text(x = x, url = link, props = no_ul))
  )
    
# Add to a slide
my_pres <- read_pptx() %>%
  add_slide() %>%
  ph_with(value = ft, location = ph_location_type(type = "body"))

print(my_pres, "~/Desktop/flex_example.pptx")

当我打开“flex_example.pptx”时,这是表格:

在此处输入图像描述

怎么去掉超链接的下划线???我希望underlined = FALSE能做到,但没有运气!

先感谢您!!!!

标签: rpowerpointflextableofficer

解决方案


推荐阅读