Problem with Htmlreg and rmarkdown: table wont show

I'm trying to make a nice table for my logistic regression output at work.

I'm using the htmlreg:

htmlreg(list(Log_Model_1_rob, Log_Model_2_rob, Log_Model_3_rob), include.ci = FALSE, custom.coef.names = c("Intercept", 
                              "Years of Education", 
                              "Age", "Women", 
                              "Norway"),
        caption = "My regression table", 
        caption.above = TRUE,
        single.row = TRUE)) 

But the table wont show in rmarkdown or if i knit it.

Instead it shows this:

Show in New WindowClear OutputExpand/Collapse Output

My regression table
Model 1 Model 2 Model 3
Intercept -1.26 (0.04)*** -1.07 (0.05)*** -1.72 (0.09)***
Years of Education -0.10 (0.01)*** -0.09 (0.01)*** -0.08 (0.01)***
Age -0.31 (0.03)*** -0.27 (0.03)***
Women -0.08 (0.03)*
Norway 0.46 (0.05)***
***p < 0.001, **p < 0.01, *p < 0.05

I have tried to follow they different options I read in here, like downloading tinytex, mactex, but nothing works.

Best regards

This works for me if I knit to HTML

---
title: "R Notebook"
output:
  html_document:
---

```{r}
library("texreg")
lm1 <- lm(Petal.Length ~ Species * Petal.Width,data=iris)
lm2 <- lm(Petal.Length ~ Species * Petal.Width + Sepal.Length,data=iris)
h <- htmlreg(list(lm1, lm2), include.ci = FALSE, 
 caption = "My regression table", 
 caption.above = TRUE,
 single.row = TRUE) 
```

html regression table is here:
```{r}
htmltools::HTML(h)

1 Like