Knitr table and formattable functions don't work in Rstudio & Shiny

369 views Asked by At

i'm trying to make my knitr tables (through KableExtra package) more appealing by adding some of the functions of the formattable package (i.e. colortile, ...).

But when running the code, the table gets visualized, but the table does not render the elements of the formattable. However I can see the HTML code in the table where the formattable functions would have to take place (6th column in the printscreen below):

enter image description here

This is my code to render the table:

input_file %>%
            mutate(
            month_perc = color_bar("lightgreen")(month_perc)) %>%
            kable(format = 'html')%>%
            kable_styling(bootstrap_options = c("hover","striped"))

Probably this is an easy fix, but does anyone have an idea why it doesn't render?

Thanks in advance!

Kind regards,

Simon

1

There are 1 answers

0
Hao On BEST ANSWER

You need escape=F in your kable function.