2

Given the following example

library(pander)
table <- Titanic[1, 1, , ]
tableWithMargins <- addmargins(table)
pander(tableWithMargins)

----------------------------
  &nbsp;     No   Yes   Sum 
----------- ---- ----- -----
 **Child**   0     5     5  

 **Adult**  118   57    175 

  **Sum**   118   62    180 
----------------------------

I would like to add lines separating my column totals, so the pandoc output would be this:

----------------------------
  &nbsp;     No   Yes   Sum 
----------- ---- ----- -----
 **Child**   0     5     5  

 **Adult**  118   57    175 
----------------------------
  **Sum**   118   62    180 
----------------------------

How can I do this? I've read ?panderOptions and ?pandoc.table, but the only thing I found was the table.style/style parameter, but setting that to simple, multiline, grid or rmarkdown do different things.

Waldir Leoncio
  • 10,853
  • 19
  • 77
  • 107
  • this would exclude the last line from your table once you compile with pandoc... – scoa May 29 '15 at 21:11
  • Your desired table format is not valid in [pandoc's markdown](http://pandoc.org/README.html#tables). What is your preferred output file? If HTML, you can do this with CSS/JS. – daroczig May 30 '15 at 02:08
  • @daroczig, I'm creating a PDF report. So I'll probably need to use `xtable` instead of `pander`, or can you think of something else? – Waldir Leoncio Jun 01 '15 at 12:17
  • 1
    @WaldirLeoncio if that's your only required output format, then it's better to stick to LaTeX for sure -- with much more options to fine-tune your document compared to what markdown can offer. – daroczig Jun 02 '15 at 00:04

0 Answers0