title: R markdown table with a caption
body: <p>I'm trying to create a table outside of a code chunk using normal markdown notation and to add a caption to it. Here's an example file (taken from <a href="http://bywordapp.com/markdown/guide.html#section-mmd" rel="noreferrer">here</a>:</p>
  
  <pre><code>---
  output: pdf_document
  ---
  
  | First Header  | Second Header | Third Header         |
  | :------------ | :-----------: | -------------------: |
  | First row     | Data          | Very long data entry |
  | Second row    | **Cell**      | *Cell*               |
  | Third row     | Cell that spans across two columns  ||
  [Table caption, works as a reference][section-mmd-tables-table1]
  </code></pre>
  
  <p>This unfortunately produces a rather sad string:
  <a href="https://i.stack.imgur.com/EDFpJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EDFpJ.png" alt="Non-table sadness with caption"></a></p>
  
  <p>Removing the caption line in square brackets produces the table fine (but without the caption, obviously):
  <a href="https://i.stack.imgur.com/k2l6B.png" rel="noreferrer"><img src="https://i.stack.imgur.com/k2l6B.png" alt="Nice table no caption"></a></p>
  
  <p>This can be achieved if I made my data into an actual data.frame and used <code>kable</code> as shown <a href="http://yihui.name/printr/" rel="noreferrer">here</a> but I'm looking to avoid having to do this.</p>