2

I'm trying to show Stargazer tables (both for regressions and data summary) in a bookdown based website. stargazer output does not look like it looks in outside bookdown (i.e markdown/knitr/html). It has spaces between rows, rows are zebra striped (abit like bootstrapped theme)

I believe that the style.css overrides stargazers' known table format, however I couldn't find any evidence to that, nor couldn't modified it by myself.

I'm sorry for asking without reprex, I find it a bit hard to make reprex to a book. Anyway, stargazer chunk is:

```{r ,results='asis'}
stargazer(lm1, type=`html`)
````
letmetype
  • 105
  • 7

1 Answers1

0

So to problem is that stargazer tables are wrapped again according to the styling in the "plugin-table.css" file that located in "./_book/libs/gitbook-2.6.7/css/plugin-table.css".

I get rid from the Kable-like formating when I remove this file it after rendering the book with these command:

bookdown::render_book("index.Rmd","bookdown::gitbook", clean_envir = TRUE) # render to HTML
file.remove("./_book/libs/gitbook-2.6.7/css/plugin-table.css")

Of course, this is not the best practice, this solution hurts kableextra formating for example. However, as I tend to use mainly Stargazer, I don't find it that bad.

letmetype
  • 105
  • 7