phez1 phez1 - 1 year ago 50
R Question

The tables in the .Rmd file are not displayed properly when exporting the file to HTML

I have a .Rmd file and I want to export it to a HTML file.
But the tables look wrong. In Rstudio the table looks good:

enter image description here

But when I export it to HTML (or PDF, Word, clicking on 'Knit'), then the table is not displayed properly:

enter image description here

Answer Source

Maybe you are looking for kable, which can output md table, and set the results option to asis.

```{r, results='asis'}
efficient <- mtcars[mtcars$mpg > 23,]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download