Issues while submitting flextable to a web pag e 67

Hi everyone, I have issues while submitting a flextable to a webpage. I have a Rmd file from which I copy the source code of the flextable. In this web I have an interactive editor (with the choice to change to html editor).
I copy the html code, add center sentence and the table seems just fine, but when I release the web page it messes up. The table is no longer centered and some borders I defined get missing.

This is what I have un Rmd:

< center>
.``` {r}
big_border = fp_border(color="black")

flextable(cbind(SE,y))%>%merge_at(i=c(nrow(cbind(SE,y))), j=c(1,2,3))%>%
add_header_lines(values = c("PANEL DE CONTROL: BOTULISMO - CIUDAD DE ROSARIO - AÑO 2019"))%>%
bg(bg="lightgrey", part="header")%>%
bg(j=1:3, bg="lightgrey", part="all")%>%
align(align = "center", part = "all")%>%
fontsize(part = "header", size = 14) %>%
fontsize(part = "body", size = 12)%>%
border_outer(part="all", border = big_border)%>%
border_inner(part="all", border = big_border)%>%
bold(part="header")%>%
bold(i=nrow(cbind(SE,y)))
.```
</ center>

Does anyone know if it's a flextable issue or anything else?

Edit: I used to have the same table made with kable package, and it worked fine with it.

Dear Maddie,

If you can provide a reproducible example, I could try to answer about the border issues.

About the centering, the examples below should help. The key is to use ft.align="left" in the chunk option to specify how to align the result table.


---
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(flextable)
```


## flextable alignments


```{r ft.align="left"}
flextable(head(iris))
```

```{r ft.align="center"}
flextable(head(iris))
```

```{r ft.align="right"}
flextable(head(iris))
```

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.