Flextable table without borders

Hello,

When I merger two cells that are close to each other, I noticed that the adjacent borders are missing.

I used this code;
Merge_at(i = 1:3, j = 1, part = “body”)

How do I do it without the borders being missing ?

I did the following, it's just fine.

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

dataset <- data.frame(Country = rep(x = c("US", "Canada"),
                                    each = 3),
                      State_Province = c("CA", "CA", "NY", "Quebec", "Quebec", "Alberta"),
                      data = LETTERS[1:6])

flextable(dataset) %>%
  border(border = fp_border(), # you can control this as per requirement
         part = "all") %>%
  merge_v(j = 1:2)

If you want to use merge_at, the following works on my system:

flextable(dataset) %>%
  border(border = fp_border(),
         part = "all") %>%
  merge_at(i = 1:3,
           j = 1) %>%
  merge_at(i = 4:6,
           j = 1) %>%
  merge_at(i = 1:2,
           j = 2) %>%
  merge_at(i = 4:5,
           j = 2)

Both of them generate this:

image

Hope this helps.

Thanks for your code and example.
I copied yours and the result on my Rstudio
is what I have described with the same issue. On the right of US and Canada there are no borders.

Not sure why yours has border and mines doesn’t. Could it be different version R studio ?