title: Python-docx - Center a cell content in an existing table after adding values
body: <p>I have a .docx template with an empty table, where I am adding values:</p>
  
  <pre><code>def manipulate_table():
  
  table = doc.tables[0]
  
  table.cell(0, 0).text = 'A'
  table.cell(0, 1).text = 'B'
  table.cell(0, 2).text = 'C'
  table.cell(0, 3).text = 'D'
  </code></pre>
  
  <p>After adding these values, the the table attribute "Centered" is gone, which is standard behaviour.</p>
  
  <p>How can I loop through my table and center all values again? I've already Googled, but found nothing helpful. E.g.: does not work:</p>
  
  <pre><code>for cell in ....????:
      tc = cell._tc
      tcPr = tc.get_or_add_tcPr()
      tcVAlign = OxmlElement('w:vAlign')
      tcVAlign.set(qn('w:val'), "center")
      tcPr.append(tcVAlign)
  </code></pre>
  
  <p>I appreciate all your help.</p>