Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spaces between columns in stargazer type = "html" table output

Tags:

r

stargazer

I`m searching for a method (or alternative) to get spaces between the columns of an stargazer html-table output.

As

stargazer::stargazer(mtcars, type = "html")

results in

enter image description here

which is not very good to read...

Thank´s in advance!

Samuel

like image 587
sammerk Avatar asked Sep 15 '15 14:09

sammerk


1 Answers

You can also drop the CSS directly into the RMarkdown document (see here). eg.

---
title: "Untitled"
author: "Author"
date: "29 June 2017"
output: html_document
---

```{css, echo = FALSE}

table, td, th {
  border: none;
  padding-left: 1em;
  padding-right: 1em;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1em;
  margin-bottom: 1em;
}

```


```{r, results = "asis"}

stargazer::stargazer(mtcars, type = "html")

```
like image 138
JWilliman Avatar answered Oct 16 '22 22:10

JWilliman