title: pandas: How to get .to_string() method to align column headers with column values?
body: <p>This has been stumping me for a while and I feel like there has to be a solution since printing a dataframe always aligns the columns headers with their respective values.</p>
  
  <p>example:</p>
  
  <pre><code>df = pd.DataFrame({'First column name': [1234, 2345, 3456], 'Second column name': [5432,4321,6543], 'Third column name': [1236,3457,3568]})
  df_string = df.to_string(justify='left', col_space='30')
  </code></pre>
  
  <p><br />
  now when you print df_string, you get the desired formatting:<a href="https://i.stack.imgur.com/H56Cp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H56Cp.png" alt="http://i.imgur.com/Xyoy4Op.png"></a>
  <br />
  <br /></p>
  
  <p>but when I take the string and view it (in this case, I'm passing the string to a PyQt widget that displays text), this is the output: <a href="https://i.stack.imgur.com/0qrLy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0qrLy.png" alt="http://i.imgur.com/a1NcBQA.png"></a>
  <br />
  <br /></p>
  
  <p>(this is how the string appears on my console): <a href="https://i.stack.imgur.com/U0xIU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U0xIU.png" alt="http://i.imgur.com/WRHEhKB.png"></a></p>
  
  <p><br />
  <br />
  Any help is greatly appreciated. </p>