title: Creating a rmarkdown table with a double vertical rule when knitting to PDF
body: <p>The following code generates a PDF file with a table when compiled from R Studio. Is there a way I can insert a double vertical bar (rule) between the variables? This would preferably use <code>pander</code> but I'm not restricted to it.</p>
  
  <pre><code>---
  output: 
      pdf_document:
          fig_caption: yes
  ---
  
  ```{r}
  pander::pander(cars[1:5,], 
                 split.cell = 80, 
                 split.table = Inf, 
                 digits = 4, 
                 caption = "Some Caption\\label{tab:sometable}",
                 justify = c('right', 'left'))
  ```
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wEWG9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wEWG9.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <h2>Edit</h2>
  
  <p>I have tried using <code>htmlTable</code> as suggested in answers below. Unfortunately this doesn't create valid markdown code such that knitr can create the PDF e.g.</p>
  
  <pre><code>---
  output: 
      pdf_document:
          fig_caption: yes
  ---
  
  ```{r}
  library('htmlTable')
  htmlTable(as.matrix(cars)[1:5, ], caption = 'Table 1: Some caption.',
            css.table = 'border-collapse: collapse; border-style: hidden; border-bottom: 1px;',
            css.cell = 'border-style: none double none none;')
  ```
  </code></pre>
  
  <p>produces:
  <a href="https://i.stack.imgur.com/EO2Lx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EO2Lx.png" alt="enter image description here"></a></p>