简体   繁体   中英

Is there a way to change the default blue header color when creating a table using pandoc in Rmarkdown

I would like to change the color of the default table produced by pandoc in Rmarkdown. The default is blue. How can change it?

Reprex:

---
title: "reprex"
author: ""
date: ""
output: ioslides_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## My Table

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+

我的桌子

The colors are controlled by CSS files. You can override the table header style by adding this in after your header block. I set the header background color to a green gradient below (#00FF00, #197419). Customize the colors by replacing those hex colors with your own values.

<style>
table.rmdtable th {
color: white;
font-size: 18px;
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, #00FF00), color-stop(80%, #197419)) no-repeat;
background: -webkit-linear-gradient(top, #00FF00 40%, #197419 80%) no-repeat;
background: -moz-linear-gradient(top, #00FF00 40%, #197419 80%) no-repeat;
background: -o-linear-gradient(top, #00FF00 40%, #197419 80%) no-repeat;
background: linear-gradient(top, #00FF00 40%, #197419 80%) no-repeat;
}
</style>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM