繁体   English   中英

在 Rmarkdown 中使用 pandoc 创建表时,有没有办法更改默认的蓝色 header 颜色

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

我想在 Rmarkdown 中更改 pandoc 生成的默认表的颜色。 默认为蓝色。 怎么可能改变呢?

代表:

---
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            |
+---------------+---------------+--------------------+

我的桌子

colors 由 CSS 文件控制。 您可以通过在 header 块之后添加它来覆盖表 header 样式。 我将 header 背景颜色设置为下方的绿色渐变(#00FF00,#197419)。 通过将这些十六进制 colors 替换为您自己的值来自定义 colors。

<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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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