Skip to content

Wrong inner borders of merged cells in PDF when bg is specified #673

@eloimercier-stemcell

Description

@eloimercier-stemcell

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

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions