Merck / r2rtf

Easily Create Production-Ready Rich Text Format (RTF) Table and Figure
https://merck.github.io/r2rtf
GNU General Public License v3.0
76 stars 19 forks source link

Using `cell_justification` provide unexpected results with `page_by`. #183

Closed fb-elong closed 1 year ago

fb-elong commented 1 year ago

example


tbl %>% 
      rtf_body(
        border_top = "single", 
        border_bottom = "single",
        text_font = 4,
        cell_justification = c("c", "l", rep("c", ncol(tbl) - 2)),
        text_color = c(rep("white", 2), rep("black", ncol(tbl) - 2)),
        col_rel_width = c(1, rel_width),
        text_background_color = c(rep("royalblue4", 2), rep("white", ncol(tbl) - 2)), 
        page_by = "group"
    ) %>% 
rtf_encode() %>% 
write_rtf("tmp.rtf")
elong0527 commented 1 year ago

The issue can be resolved by changing cell_justification to text_justification