title: Pandas DataFrame to HTML: Formatting the values to display centered
body: <p>I have a <code>pandas</code> <code>DataFrame</code> and am using the <code>DataFrame.to_html</code> method to generate a table I can send within an HTML email message. I simply want the values in certain columns to be centered, but would also like to know in general how to apply formatting to the table. I have tried applying the documentation found <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_html.html" rel="nofollow noreferrer">HERE</a> as well as using <code>df.style</code> before using <code>to_html</code> like so:</p>
  
  <pre><code>df.style.set_properties(**{'text-align':'center'})
  </code></pre>
  
  <p>But i am still getting all of my values left-aligned (other than the headers, which are centered).</p>
  
  <p>What is the correct way to center all (or a subset) of my column values, and what are the other options available for formatting? (e.g. bolding text, changing background or border colors, etc.)</p>
  
  <p>Further, at what stage should this formatting be applied? Within the <code>to_html</code> method or prior to it as I tried with <code>df.style</code>? Thanks!</p>