davidgohel / flextable

table farming
https://ardata-fr.github.io/flextable-book/
554 stars 79 forks source link

Adding footnote removes the right-side border in footer #550

Closed Generalized closed 1 year ago

Generalized commented 1 year ago

Hi, after adding the footnotes, the right border disappears. It's visible in both HTML and DOCx output (I didn't check the others). It can be restored manually.

mtcars %>% 
    flextable() %>%
    footnote(i = 1, j = 1,
             value = as_paragraph(as_chunk("Text", 
                                           props = fp_text(font.family = "Arial Narrow", font.size = 9))),
             ref_symbols = c("*"),
             part = "header", inline = TRUE) %>% 
    footnote(i = 1, j=1,
             value = as_paragraph(as_chunk("Text",
                                           props = fp_text(font.family = "Arial Narrow", font.size=9))),

             ref_symbols = c("**"),
             part = "body", inline = TRUE) %>% 
    border_remove() %>% 
    border_outer(part = "all", border = fp_border(color="#303030", width = 1) ) %>% 
    hline(part = "header", border = fp_border(color="#303030", width = 1.5) ) 

The right border is missing in the footer section: obraz

It can be fixed only by calling one function - border (neither vline_right nor border_outer works):

mtcars %>% 
    flextable() %>%
    footnote(i = 1, j = 1,
             value = as_paragraph(as_chunk("Text", 
                                           props = fp_text(font.family = "Arial Narrow", font.size = 9))),
             ref_symbols = c("*"),
             part = "header", inline = TRUE) %>% 
    footnote(i = 1, j=1,
             value = as_paragraph(as_chunk("Text",
                                           props = fp_text(font.family = "Arial Narrow", font.size=9))),

             ref_symbols = c("**"),
             part = "body", inline = TRUE) %>% 
    border_remove() %>% 
    border_outer(part = "all", border = fp_border(color="#303030", width = 1) ) %>% 
    hline(part = "header", border = fp_border(color="#303030", width = 1.5) ) %>% 

    border(i=1,j=1,  border.right = fp_border(color="#303030", width = 1), part = "footer")

obraz

davidgohel commented 1 year ago

You can add fix_border_issues() at the end of the chain

github-actions[bot] commented 8 months ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.