title: Using table caption on R markdown file using knitr to use in pandoc to convert to pdf
body: <p>I am wondering if it is possible to use the table captions like figure captions using knitr in .Rmd file ? </p>
  
  <p>I saw options for figure caption but I couldn't see the option for the table caption. I also want to remove the message such as <code>"% latex table generated in R 2.15.2 by xtable 1.7-0 package % Wed Mar 06 15:02:11 2013"</code> . </p>
  
  <p>I used X table to create the table: The sample code I used is as follows:</p>
  
  <pre><code>```{r table2, results='asis', message=FALSE} 
  library(xtable) 
  print(xtable(head(iris))) 
  ``` 
  </code></pre>
  
  <p>The table I got after processing through pandoc is as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/lX0Ya.png" alt="enter image description here"></p>
  
  <p>I tried to use message=FALSE in Rmd file to get rid of the message shown above. I also want to know if it is possible to automatically add the caption for table in Rmd ? </p>
  
  <p>By caption I mean something like below (this is for the figure) and the figure number is automatically updated. </p>
  
  <p>This output is a snapshot from the pdf generated by pdf using the markdown file created by knitr.</p>
  
  <p><img src="https://i.stack.imgur.com/pfinJ.png" alt="enter image description here"></p>
  
  <p>Thank you.</p>