Search code examples
htmlcssrr-markdownstargazer

How to change colour of only used borders in html table?


I have this table in my Rmd presentation:

enter image description here

that was obtained doing stargazer(fit, type = "html")

I tried to include css in my Rmd like:

table, th, td {border: 1px solid white;}

And the result is:

enter image description here

I want to re-colour just actually used borders. Like this (photoshop edited):

enter image description here

My idea is to do this using css because I have more than 40 tables. How can I do that?


Solution

  • So you're just wanting to change the colors? Try just using the border-color property, otherwise adding size and type will create a new border. So for example,

    table, th, td {
      border-color: white;
    }