0
votes

There must be some mismatch that I'm not understanding. When I render a pdf using knitr::kable with caption in Rstudio, the caption is on the top of the table and when I render it from shiny server pro from the web page, the caption is at the bottom of the table. There were no error in the log file. I don't understand what is different. My simple kable statement is : knitr::kable(data_table,format.args = list(big.mark = ','),caption = "My Caption")

The knitr version I'm using is 1.15.1

What is causing the caption to go below when I render the pdf through shiny server pro web page?

1

1 Answers

0
votes

Please set the format to pandoc, that will work

knitr::kable(data_table,format.args = list(big.mark = ','),format="pandoc",caption = "My Caption")

MWE

knitr::kable(data.frame (h1=c("a","b"),h2=c(10,11)),format = "pandoc", caption = "My header here", row.names = FALSE)

Output looks like this

Table: My header here

h1 h2


a 10

b 11