I use knitr to create dynamic documents. If the table is too wide to fit the width of the page (screen), is there a way to force it to fit the page while maintaining the scroll bar below the table so that you can slide the panel from left to right and read the contents of the table?
Here is the test code
---
title: "Untitled"
author: "ath"
date: "07/02/2015"
output:
html_document:
css:custom.css
---
```{r set-options}
options(width = 80)
```
```{r test, results='markup'}
df.matrix <- matrix(runif(300, min = 0, max = 300), nrow = 2)
df.matrix <- as.data.frame(df.matrix)
colnames(df.matrix) <- paste("col", as.character(seq(1:150)), sep = "")
library("knitr")
kable(df.matrix, col.names = colnames(df.matrix))
```
It seems that the width in the options is not working.
Thank!
source
share