```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` Behind the scene, for HTML tables, `kableExtra` uses `xml2` to add styles and new contents to existing table. `kableExtra` is trying its best to get you the result in a literal way but in some rare case, I hope you can have the ability to freedom to be a HTML Ninja (quoting @yihui's xaringan). :) In `kableExtra` 1.0, I exported two functions that were previously used internally in this package: `kable_as_xml` and `xml_as_kable`. Here is an example for how to use these 2 function and xml2 to hack your table and do something `kableExtra` is not capable to do (at least right now). ```{r} library(kableExtra) library(xml2) demo <- kable(mtcars[1:4, 1:4]) %>% # As always, mtcars ;) kable_styling(full_width = F) %>% kable_as_xml() demo %>% # Transform to xml xml_child(2) %>% # Select
(1 is ) xml_child(2) %>% # Select 2nd row