国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Implementieren Sie verschiedene benutzerdefinierte CSS (Schriftfarben) für Kable-Header in fortlaufenden Tabellen
P粉563831052
P粉563831052 2023-09-01 19:53:36
0
2
724
<p>Ich m?chte einen blauen Titel und dann einen roten Titel. Ich<code>cat</code> zwei HTML-Abschnitte <code><style>...</style></code>, laut dieser Antwort, aber ich werde rot beide. </p> <p>Wie bekomme ich einen blauen und einen roten Titel? </p> <pre class="brush:php;toolbar:false;">--- Ausgabe: html_document --- ?{r setup, include=FALSE} knitr::opts_chunk$set(echo=FALSE) ? ?{r results="asis"} Katze(" <Stil> Untertitel { Farbe blau; } </style> ") knitr::kable(head(iris), format="html", Ziffern=4, row.names=FALSE, caption='Beschriftung blau', escape=TRUE)|> kableExtra::kable_styling(font_size=14) |> kableExtra::kable_paper(c('hover', 'pressed', 'responsive'), full_width=T) |> kableExtra::scroll_box(width="100%", height="200px") ? ?{r results="asis"} Katze(" <Stil> Untertitel { Farbe Rot; } </style> ") knitr::kable(head(iris), format="html", Ziffern=4, row.names=FALSE, caption='Beschriftung rot', escape=TRUE) |> kableExtra::kable_styling(font_size=14) |> kableExtra::kable_paper(c('hover', 'pressed', 'responsive'), full_width=T) |> kableExtra::scroll_box(width="100%", height="200px") ```</pre>
P粉563831052
P粉563831052

Antworte allen(2)
P粉865900994

您還可以為每個表提供一個特殊的 HTML 類,然后將所有樣式收集在 css 塊中,而不是在每個塊中指定 CSS:

---
output: html_document
---

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

```{css}
.mytable1 > caption {
    color: blue;
}
.mytable2 > caption {
    color: red;
}
```

```{r results="asis"}
knitr::kable(head(iris), 
             format="html",
             digits=4,
             row.names=FALSE,
             caption='Caption blue',
             escape=TRUE)|>
  kableExtra::kable_styling(font_size=14, htmltable_class = "mytable1") |>
  kableExtra::kable_paper(c('hover', 'condensed', 'responsive'), full_width=T) |>
  kableExtra::scroll_box(width="100%", height="200px") 
```


```{r results="asis"}
knitr::kable(head(iris), 
             format="html",
             digits=4,
             row.names=FALSE,
             caption='Caption red',
             escape=TRUE) |>
  kableExtra::kable_styling(font_size=14, htmltable_class = "mytable2") |>
  kableExtra::kable_paper(c('hover', 'condensed', 'responsive'), full_width=T) |>
  kableExtra::scroll_box(width="100%", height="200px")
```

或者,我們可以在塊之外插入內(nèi)聯(lián) CSS。

<style>
.mytable1 > caption {
  color: blue;
}
.mytable2 > caption {
  color: red;
}
</style>
P粉156983446

因為第二個CSS覆蓋了第一個CSS。

最好這樣做:

cat("
<style>
.blue-caption {
      color: blue;
    }

.red-caption {
      color: red;
    }
</style>
")

然后像這樣使用:

caption='<span class=\"blue-caption\">Caption blue</span>',
caption='<span class=\"red-caption\">Caption red</span>',

有效嗎?

問候, 諾埃爾

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage