Tanga94
Tanga94

Reputation: 837

How to italicize part of caption in kable

I have created a table using the kableExtra package. Is there a way in which I can italicize the second sentence in the caption

library(tidyverse)
library(kableExtra)

head(iris) %>% kable() %>% kable_styling() %>% 
  footnote(general= 'Here is my footnote. I want this sentence in italics')


Upvotes: 1

Views: 1137

Answers (1)

akrun
akrun

Reputation: 887038

We can use the <i>/</i>

library(dplyr)
library(kableExtra)
head(iris) %>%
   kable() %>% 
   kable_styling() %>% 
   footnote(general="Here is my footnote. <i>I want this sentence in italics</i>", escape = FALSE)

-output

enter image description here

Upvotes: 3

Related Questions