jim mako
jim mako

Reputation: 561

rmarkdown - Increasing html width to fit entire table

I was looking for a way to change the setting in my Rmd file so that the html output contains all the columns and the table does not break. I tried to change the css properties as in this solution (Output table width in Rmarkdown) but this does not affect my output.

I have currently 17 columns and using a pandoc.table, but only 5 coloumns are shown before the table is broken and the next 5 columns are displayed below.

What changes do I need to make so that the entire table can be shown in my html output?

Thanks for your help.

Upvotes: 1

Views: 2813

Answers (1)

F. Correhuela
F. Correhuela

Reputation: 143

I can't use the pandoc package because is not currently available for R version 3.2.0. Instead, I used knitr with the kable() function. This code works fine:

{r, echo=FALSE, results='asis'}
library(knitr)
examp <- data.frame(matrix(rep("Unicorn"), nrow=5, ncol=100))
kable(examp)

I think, because you don't provide an example, that you need to specify the results='asis' chunk option. Try ?kable for further information.

Anyway ?pandoc.table shows that there is an option split.table that may help.

Upvotes: 1

Related Questions