Add styling rules in pandoc tables for odt/docx output (table borders)
07:56 25 Jul 2013

I'm generating some odt/docx reports via markdown using knitr and pandoc and am now wondering how you'd go about formating tables. Primarily I'm interested in adding rules (at least top, bottom and one below the header, but being able to add arbitrary ones inside the table would be nice too).

Running the following example from the pandoc documentation through pandoc (without any special parameters) just yields a "plain" table without any kind of rules/colours/guides (in either -t odt or -t docx).

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+

I've looked through the "styles" for the possibility of specifying table formating in a reference .docx/.odt but found nothing obvious beyond "table header" and "table contents" styles, both of which seem to concern only the formatting of text within the table.

Being rather unfamiliar with WYSIWYG-style document processors I'm lost as to how to continue.

docx pandoc odt