简体   繁体   中英

Is it possible to change the hover colour in kableExtra?

I regularly use the kable and kableExtra packages to create beautiful html tables via Rmarkdown.

A client of mine recently requested the hover colour be yellow, rather than the current shade of grey. Does anyone know if this is at all possible?

An reproducible example:

require(knitr)
require(kableExtra)
kable(mtcars, "html") %>%
  kable_styling(bootstrap_options = c("striped", "hover"))

Of course it is. Just add the following lines in your Rmd document:

<style>
.table-hover > tbody > tr:hover { 
  background-color: #f4f442;
}
</style>

Just change the color value #f4f442 to whatever your client likes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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