rmarkdown-cookbook icon indicating copy to clipboard operation
rmarkdown-cookbook copied to clipboard

Add an example for kable html format to get same display as Pandoc Markdown table

Open cderv opened this issue 3 years ago • 1 comments

See discussion in https://github.com/rstudio/rmarkdown/issues/1954#issuecomment-733070556

With this, markdown table will be used, and displayed using bootstrap style by rmarkdown

---
title: "table format"
output: html_document
---

```{r}
knitr::kable(iris)
```

With this, it won't use bookstrap style

---
title: "table format"
output: html_document
---

```{r}
knitr::kable(iris)
```

unless you add the class yourself

---
title: "table format"
output: html_document
---

```{r}
knitr::kable(iris, "html", table.attr = 'class="table table-condensed"')
```

cderv avatar Nov 25 '20 15:11 cderv

And suggestion is to have an option to set it globally https://github.com/yihui/knitr/pull/1922

cderv avatar Nov 25 '20 15:11 cderv