Is there a way of changing the text colour of a single cell/multiple cells?
For example, I have a table that I changed the colour of all text to red. But I want the diagonal colour to be blue
Is there a way to achieve this?
I have tried to use testStats[1, 2] <- cell_spec(testStats[1, 2], "latex", color = "blue") to change colour for one cell.
But doesn't seem to work.
library(kaleExtra)
test = iris
testStats = as.data.frame(apply(iris[,1:4], 2, summary))
kable(testStats, booktabs =TRUE,caption = "Sample") %>%
kable_styling(latex_options = c('hold_position')) %>%
column_spec(2:5, color = "red")
testStats[1, 2] <- cell_spec(testStats[1, 2], "latex", color = "blue")
