HTML rmarkdown 文件中的 Kable 标题以粗体显示

Kable caption in rmarkdown file in HTML in bold

我想将我的 table 标题设为粗体,但似乎找不到合适的选项。

我的代码是(在 rmarkdown 文档中):

kable(head(iris), caption = 'I want this in Bold') %>% 
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) 

输出为:

这个markdown-oriented解决方案对你有用吗?

```{r, results='asis'}
kable(head(iris), caption = '**I want this in Bold**') %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover", "condensed","responsive"))
```

for html-输出应该有效:

```{r, results='asis'}
kable(head(iris), caption = '<b>I want this in Bold</b>', format = 'html') %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover", "condensed","responsive"))
```

对于pdf-输出应该有效:

```{r, results='asis'}
kable(head(iris), caption = '\textbf{I want this in Bold}', format = 'latex') %>% 
  kableExtra::kable_styling(bootstrap_options = c("striped", "hover", "condensed","responsive"))
```