title: How to center flushed-right column text in Kable?
body: <p>I am having a dataframe with both character and numeric columns. I am trying to center the character column (which is done) and (I don't know how to) center flushed-right numeric column. Further, both column names are centered:
  <a href="https://i.stack.imgur.com/wt2df.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wt2df.png" alt="desired look"></a></p>
  
  <p>Some relevant posts (<a href="https://stackoverflow.com/questions/49143690/rmarkdown-kable-vertically-align-cells">this</a> and <a href="https://tex.stackexchange.com/questions/347799/how-to-center-a-block-of-the-lines-while-flushleft-flushright-is-applied">this</a>), but I couldn't incorporate the techniques (if relevant) to my code. </p>
  
  <p>The following code produces the table below:</p>
  
  <pre><code>df &lt;- data.frame(name = c("a", "bb", "ccc"), number = c(10, 193048, 200))
  
  kable(df, format="latex", align = c("c", "r")) %&gt;% 
    kable_styling(full_width = TRUE) %&gt;% 
    row_spec(0, align = "c")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tSY2L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tSY2L.png" alt="current look"></a></p>
  
  <p>I understand that I can use LaTeX code to produce a single user-customised table. But I need the example to be reproducible in Rmd (imagine I have lots of <code>df</code>) and therefore need to specify within <code>kable()</code>.</p>
  
  <p>Should I modify the LaTeX table environment (i.e. <code>\begin{tabu} to \linewidth {&gt;{\centering}X&gt;{\centering}X}</code>) and if so how in R, or use something like <code>multirow</code> to customise the second column??</p>