繁体   English   中英

flextable Header 带 border.right 参数的边框

[英]flextable Header Border with border.right argument

我试图在 header 的两侧放置垂直边框,并且能够在左侧而不是右侧获得边框。

library(officer)
library(flextable)
library(dplyr)
bigborder <- fp_border(style = "solid", width=2)
flextable(head(iris)) %>%
  add_header_row(top = TRUE, values = c("12", "3", "45"), colwidths = c(2,1, 2)) %>%
  add_header_row(top = TRUE, values = c("123", "45"), colwidths = c(3, 2)) %>%
  border(border.left = bigborder, j = 1, part = "all") %>%
  border(border.right= bigborder, j = 5, part = "all")

这是在 header 部分设置垂直边框的示例:

library(officer)
library(flextable)
library(magrittr)
bigborder <- fp_border(style = "solid", width=2)
thinborder <- fp_border(color="gray", width=.5)
flextable(head(iris)) %>% 
  add_header_row(top = TRUE, values = c("12", "3", "45"), colwidths = c(2,1, 2)) %>%
  add_header_row(top = TRUE, values = c("123", "45"), colwidths = c(3, 2)) %>%
  border_remove() %>% 
  vline(border = thinborder, part = "header") %>%
  vline_left(border = bigborder, part = "header") %>%
  vline_right(border = bigborder, part = "header") %>% 
  align(align = "center", part = "header") %>% 
  fix_border_issues()

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM