title: Left align the first column and center align the other columns in a Pandas table
body: <p>I am trying to format a Pandas table. I want to left align the first column and center align the other two columns in a Pandas table (except for the table header).</p>
  
  <p>Code:</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  from IPython.display import HTML
  df = pd.DataFrame({'Unit': ['Bit', 'Nibble','Byte/Octet', 'Kilobyte', 'Megabyte', 'Gigabyte', 'Terabyte'], 'Abbreviation': ['b', '-', 'B', 'KB', 'MB', 'GB', 'TB'], 'Storage': ['Binary digit, single 0 or 1', '4 bits', '8 bits', '1024 bytes', '1024 KB', '1024 MB', '1024 GB']})
  df.style.set_properties(**{'text-align': 'center'})
  </code></pre>
  
  <p>I'm using Google Colab to render the table.</p>
  
  <p>Results:</p>
  
  <p><a href="https://i.stack.imgur.com/cnLEV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cnLEV.png" alt="Results in Google Colab"></a></p>
  
  <p>This table is almost what I want. I'm trying to print the same table except that I want to hide the index numbers and left align the first column, so that I have a table with 7 rows + 1 header and 3 columns that looks like this.</p>
  
  <p><a href="https://i.stack.imgur.com/ribbT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ribbT.png" alt="enter image description here"></a></p>
  
  <p>I tried using <code>df.style.hide_index()</code> to hide the index numbers and it worked, but I couldn't figure out how to combine <code>df.style.hide_index()</code> with <code>df.style.set_properties(**{'text-align': 'center'})</code> The first screenshot shows all three columns are center aligned and I want to left align the first column and center align the 2nd and 3rd columns, except for the header which should have all three columns center aligned.</p>