title: R markdown wrapping big tables at end of page in pdf document
body: <p>I am using R studio and R markdown (with <code>knitr</code>) to create pdf or html report of my results. I have then used function <code>kable</code> to make the table look nice on a PDF output or function <code>htmlTable</code> of library <code>expss</code> for html output. I have created a big table for example like: </p>
  
  <p><code>cbind(row.number=1:10,iris[1:10,],iris[1:10,],iris[1:10,]) -&gt; tbl1</code></p>
  
  <p>The problem is that this table has too many columns they go outside the width of the paper. Is there a way to wrap the table with one column repeated as first column. Using the table in the example above, the output should be something like: </p>
  
  <p><code>row.number Sepal.Length Sepal.Width Petal.Length
  1           1          5.1         3.5          1.4
  2           2          4.9         3.0          1.4
  3           3          4.7         3.2          1.3</code></p>
  
  <p><code>row.number Petal.Width Species Sepal.Length
  1           1         0.2  setosa          5.1
  2           2         0.2  setosa          4.9
  3           3         0.2  setosa          4.7</code></p>
  
  <p><code>row.number Sepal.Width Petal.Length Petal.Width
  1           1         3.5          1.4         0.2
  2           2         3.0          1.4         0.2
  3           3         3.2          1.3         0.2</code></p>
  
  <p>To be continued like this. I created this just by hand, I have not solved the problem already :)</p>
  
  <p>I saw here that it is possible to decrease the size to the table, but that is not rely what I was looking for. 
  <a href="https://stackoverflow.com/questions/16507191/automatically-adjust-latex-table-width-to-fit-pdf-using-knitr-and-rstudio/21256277">Automatically adjust LaTeX table width to fit pdf using knitr and Rstudio</a></p>