The below document gives the following HTML output (only HTML required)
The first columns are way to wide, and Reduce cell width and font size of table using pandoc.table() does not help here.
How can I force the first 2 columns to waste less space?
---
output: html_document
---
```{r,echo=FALSE, results="asis"}
library(pander)
mytab = data.frame(col1=1:2, col2=2001:2002, col3="This is a lengthy test that should wrap, and wrap again, and again and again and again")
pandoc.table(mytab)
```
pandoc.table
supports specifying the width of columns via thesplit.cells
argument, which can take a simple number or a vector of (relative) numbers/percentages, Quick demo:This results in the following HTML after converting the above markdown to HTML with
pandoc
: