title: Matplotlib Table- Assign different text alignments to different columns
body: <p>I am creating a two column table and want the text to be as close as possible. How can I specify that the first column be right aligned and the second be left aligned?</p>
  
  <p>I've tried by setting the general cellloc to one side (cellloc sets the text alignment)</p>
  
  <pre><code>from matplotlib import pyplot as plt
  
  data = [['x','x'] for x in range(10)]
  bbox = [0,0,1,1]
  
  tb = plt.table(cellText = data, cellLoc='right', bbox = bbox)
  plt.axis('off') # get rid of chart axis to only show table
  </code></pre>
  
  <p>Then looping through cells in the second columns to set them to left align:</p>
  
  <pre><code>for key, cell in tb.get_celld().items():
      if key[1] == 1: # if the y value is equal to 1, meaning the second column
          cell._text.set_horizontalalignment('left') # then change the alignment
  </code></pre>
  
  <p>This loop immediately above has no effect, and the text remains right aligned.</p>
  
  <p>Am I missing something? Or is this not possible?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>A workaround is for me to separate the data into two different lists, one for each column. This produces the results I'm looking for, but I'd like to know if anyone knows of another way.</p>
  
  <pre><code>data_col1 = [xy[0] for xy in data]
  data_col2 = [xy[1] for xy in data] 
  
  tb = plt.table(cellText = data_col2, rowLabels=data_col1, cellLoc='left', rowLoc='right', bbox = bbox)
  </code></pre>