blob: 55f81b3e8bbbda5e397323a895b82eb72df33cb1 [file] [log] [blame]
Hao Zhu064990d2017-10-17 18:08:42 -04001---
2title: "Untitled"
3author: "Hao"
4date: "10/15/2017"
5output: html_document
6---
7
8```{r, include=FALSE}
9library(knitr)
10library(kableExtra)
11library(tidyverse)
12```
13
14```{r}
15htmlFun = function(content) {
16 x = htmltools::tags$div(content, class = 'error')
17 # you could also do this if you don't care about escaping HTML entities in 'content':
18 # x = htmltools::HTML(paste('<div class="error">', content, '</div>'))
19 d = htmltools::htmlDependency(
20 'knitr-css', '1.2.3', src = system.file('misc', package = 'knitr'),
21 stylesheet = 'knitr.css'
22 )
23 x = htmltools::attachDependencies(x, d)
24 x
25}
26
27htmlFun('Hello World!')
28```
29
30```{r}
31mtcars[1:5, 1:2] %>%
32 mutate(mpg = cell_spec(mpg, tooltip = cyl)) %>%
33 kable("html", escape = F) %>%
34 htmltools::HTML()
35```