Reputation: 11379
I would like to add spacing or padding to a html table generated by xtable.
The print.xtable() parameter html.table.attributes
doesn't work for me.
Here an example chunk that can be pasted in a Rmd document.
```{r results='asis'}
library(xtable)
print(xtable(cars), type='html',
html.table.attributes = 'cellspacing="5" cellpadding="5"',
include.rownames = FALSE, include.colnames=FALSE,
comment = FALSE)
```
It's a simple standalone example and I wouldn't like to create a css file for this: more details on the purpose.
Upvotes: 3
Views: 1153
Reputation: 3330
You can add CSS rules to a style sheet in the R Markdown document with the style tags.
<style>
th,td{
padding:2px 5px 2px 5px;
}
</style>
Upvotes: 3