Formatting table headings in Rmarkdown
<p>I don't understand why I can't get the following table examples to format correctly when using the knitr and markdown packages in RStudio. In each case, the content below the column headings is fine, but the column headings are always left aligned no matter what formatting is used.</p>

<p>Here is my test .Rmd file based on the examples from the Markdown help files at</p>

<p><a href="http://pandoc.org/README.html#tables" rel="nofollow">http://pandoc.org/README.html#tables</a></p>

<p>and</p>

<p><a href="http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html#tables" rel="nofollow">http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html#tables</a></p>

<pre><code>---
output:
  html_document
---

# Table tests


## Simple table

  Right     Left     Center     Default
-------     ------ ----------   -------
     12     12        12            12
    123     123       123          123
      1     1          1             1

## Multiline table

-------------------------------------------------------------
 Centered   Default           Right Left
  Header    Aligned         Aligned Aligned
----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here's another one. Note
                                    the blank line between
                                    rows.
-------------------------------------------------------------

## Piped table

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

## cat() table

This is another option that I found [here](https://stackoverflow.com/questions/19997242/simple-manual-rmarkdown-tables-that-look-good-in-html-pdf-and-docx?rq=1), which _should_ work well under many formats .

```{r, echo=FALSE, results='asis'}
tabl &lt;- "
| Tables        | Are           | Cool  |
|---------------|:-------------:|------:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |
"
cat(tabl)
```
</code></pre>

<p>Here is my <code>sessionInfo</code>:</p>

<pre><code>R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.3 (unknown)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] htmltools_0.3.5 tools_3.2.0     yaml_2.1.13     Rcpp_0.12.4     rmarkdown_0.9.5 knitr_1.12.3    digest_0.6.9
</code></pre>

<p><a href="https://faculty.washington.edu/scheuerl/table_test.html" rel="nofollow">Here is the result of knitting it in RStudio</a>.</p>