title: Applying styling to Pandas dataframe saved to HTML file
body: <p>I have a Pandas dataframe inside of a Jupyter / IPython notebook. The dataframe's style as an HTML table inside of Jupyter is pretty nice. The header row has bold style, the font is nice, and the table borders are thin.</p>
  
  <p><a href="https://i.stack.imgur.com/o8vD9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/o8vD9.png" alt="enter image description here"></a></p>
  
  <p>I then export the dataframe to an HTML file (following instructions <a href="https://stackoverflow.com/questions/14897833/save-pandas-to-html-as-a-file">here</a> and <a href="https://stackoverflow.com/questions/32430009/python-pandas-data-frame-save-as-html-page">here</a>):</p>
  
  <pre><code>df.to_html('myfile.html')
  </code></pre>
  
  <p>But the resulting HTML file's table styling is not good.</p>
  
  <p><a href="https://i.stack.imgur.com/lGbBA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lGbBA.png" alt="enter image description here"></a></p>
  
  <p>The HTML in that file is plain:</p>
  
  <pre><code>&lt;table border="1" class="dataframe"&gt;
    &lt;thead&gt;
      &lt;tr style="text-align: right;"&gt;
        &lt;th&gt;&lt;/th&gt;
        &lt;th&gt;Id&lt;/th&gt;
        &lt;th&gt;Index&lt;/th&gt;
        &lt;th&gt;Feature&lt;/th&gt;
        &lt;th&gt;Timestamp&lt;/th&gt;
        &lt;th&gt;Feature2&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
  </code></pre>
  
  <p>How do I modify the styling of this exported table directly from my Python / Pandas code?</p>