title: Python-docx ,Error when trying to set a table cell sytle as 'toc 2'
body: <p>I am new to python-docx module.</p>
  
  <p>What i have is a table which is already in the document.</p>
  
  <p>I want table to have some features so i made it by hand and add 1 row as
  i wish (first column is for numbering ,its style is "toc 2").</p>
  
  <p>What i am trying to do is ,first set text to first row (done!),
  then copy the first row and change the text with other datas.</p>
  
  <p>I have managed to copy and change the data in new rows
  but i can't add numbering style to them.
  i have a line of code like:</p>
  
  <p><code>new_row.cell[0].paragraph[0].add_run(" ").style('toc 2')</code></p>
  
  <p>And i have tried to set text first then change the style like:</p>
  
  <p><code>new_row.cell[0].paragraph[0].add_run(" ")
  new_row.cell[0].paragraph[0].style = document.styles['toc 2']</code></p>
  
  <p>But both are giving me the same error:</p>
  
  <p><code>CT_Tbl object has no attribute part</code></p>
  
  <p>Any suggestions?</p>
  
  <p>NOTE: i am creating new_row with this function:</p>
  
  <p><code>def insert_row(table,index):
      new_row = table.add_row()
      table.rows._tbl.insert(index , new_row._tr)
      return new_row
  </code>
  NOTE2: Tracecall:</p>
  
  <pre><code>Traceback (most recent call last):
      File "D:\ws\docx_projects\automation.py", line 351, in tablo_doldur
          cell_text = new_row_cells[0].paragraphs[0].add_run("").style('toc 2')
      File "C:\Python27\lib\site-packages\docx\text\run.py" ,line 132 ,in style
          return self.part.get_style(style_id , WD_STYLE_TYPE_CHARACTER)
      File "C:\Python27\lib\site-packages\docx\shared.py" ,line 250 ,in part
          return self._parent.part
      File "C:\Python27\lib\site-packages\docx\shared.py" ,line 250 ,in part
          return self._parent.part
      File "C:\Python27\lib\site-packages\docx\shared.py" ,line 250 ,in part
          return self._parent.part
      File "C:\Python27\lib\site-packages\docx\shared.py" ,line 250 ,in part
          return self._parent.part
  AttributeError: 'CT_Tbl' object has no attribute 'part'
  </code></pre>