You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When bg() is specified, the inner borders of individual cells are still displayed even in the merged cells. This only occurs in PDF.
Removing the background colour fixes this issue. fix_border_issues() does not help here.
data_1 <- data.frame(col1 = c("A1", "A1", "A1"),
col2 = c("B1", "B2", "B3"))
ft <- flextable(data_1)
ft <- ft %>% bg(i=1, bg = "grey90", part = "header") #removing this row fixes the issue
ft <- ft %>% merge_v( j = ~ col1)
ft <- ft %>% border_inner( part="body", border = fp_border(color="red", width = 2) )
print(ft) # the inner borders are displayed properly
print(ft, preview = "pdf") # the inner borders are displayed incorrectly in the merged cells
The text was updated successfully, but these errors were encountered:
eloimercier-stemcell
changed the title
Wrong inner border of merge cells in PDF when bg is specified
Wrong inner borders of merged cells in PDF when bg is specified
Jan 6, 2025
When bg() is specified, the inner borders of individual cells are still displayed even in the merged cells. This only occurs in PDF.
Removing the background colour fixes this issue. fix_border_issues() does not help here.
Reproducible example
library(flextable)
library(officer)
library(dplyr)
data_1 <- data.frame(col1 = c("A1", "A1", "A1"),
col2 = c("B1", "B2", "B3"))
ft <- flextable(data_1)
ft <- ft %>% bg(i=1, bg = "grey90", part = "header") #removing this row fixes the issue
ft <- ft %>% merge_v( j = ~ col1)
ft <- ft %>% border_inner( part="body", border = fp_border(color="red", width = 2) )
print(ft) # the inner borders are displayed properly
print(ft, preview = "pdf") # the inner borders are displayed incorrectly in the merged cells
The text was updated successfully, but these errors were encountered: