Slidy Presentations all seem to cluster everything tight to the left. How do I align things in the center or increase the margin sizes so that stuff doesn't look so tight to the left? Note, I'm not talking about using the align argument to xtable(). It's not that I want the text of the tables center aligned, I want the table physically in the center of the slide. Can I include html code in an RMarkdown document? Or do I need to modify the CSS?
---
output: slidy_presentation
---
## R table
How do I get this table aligned in the center?
```{r results='asis'}
library(xtable)
tab1<-c(seq(1,10,1))
print(xtable(table(tab1)), type='html')```
## Bullet lists
- And how do I align this in the center
- Or just add some spacing on the left?
## Regression Table
```{r echo=TRUE}
mod<-lm(temperature~pressure, data=pressure)```
## stargazer table
- And how do I align this in the center?
```{r results='asis', echo=F, warning=F, message=F}
library(stargazer)
stargazer(mod, type = 'html')```
I think I am more interested in in modifying the css options, but I can't say it is overly clear. I don't understand how the arguments relate to the slide header, for example. Do they come just after, on a second line? do they have to refer back to the header's name? I mean in the slidy help documentation, this is the example
`## Next Steps {#nextsteps .emphasized}
Would enable you to apply CSS to all of it’s content using either of the following CSS selectors:
#nextsteps {
color: blue;
}
.emphasized {
font-size: 1.2em;
}
`
So, where would I find the arguments for horizontal alignment? And why is the slide header the same as the css code? ## Next Steps {#nextsteps .emphasized}
As for the first table, you can easily do something like this :
## R table
How do I get this table aligned in the center?
<div align="center">
```{r echo=FALSE, results='asis'}
library(xtable)
tab1<-c(seq(1,10,1))
print(xtable(table(tab1)), type='html')
``` </div>
and the table is rendered in the center.
As for the bullets you can play with html and css to get them to the center :
## Bullet lists
<div align="center">
<div style="width: 60%; margin:0 left;text-align: left;">
<li>And how do I align this in the center</li>
<li>Or just add some spacing on the left?</li>
</div>
</div>