How to change the strip color on kableExtra

Viewed 2717

The color of the strips are very lite on Kable on Pdf output. So is there a way to change the color on kable_styling(latex_options = "striped")?

2 Answers

Cobbling together the link provided by @S.Perera above (where @hao states no functionality for hex codes yet), deciding I didn't like the available LaTeX color codes found here (code for modifying just below that), an attempt to change stripe color described here, and my own desire to fine-tune with hex codes, I came up with the following:

In the YAML:

---
output:
  pdf_document:
    latex_engine: xelatex
header-includes: \definecolor{ltgray}{HTML}{D3D3D3}
---

ltgray is the new name for the color, HTML is the model (you can also do RGB or CMYK), and D3D3D3 is the hex code for the color I want. Assuming my dataframe for the table is called df:

kable(df, format = "latex", booktabs=TRUE) %>%
    kable_styling(latex_options = "striped", stripe_color="ltgray")
Related