Open VaishnaviDaware opened 2 years ago
Can we delete row from existing table from pptx developed by Python-Pptx.
I want to delete last 7th row from table. Is there anyway to do it?
And if we have use below function could you please provide any example of code for the same.
def remove_row(table: Table, row_to_delete: _Row) -> None: table._tbl.remove(row_to_delete._tr)
OR
def remove_row(table, row): tbl = table._tbl tr = row._tr tbl.remove(tr)
row = table.rows[n] remove_row(table, row)
Thank you
Originally posted by @VaishnaviDaware in https://github.com/scanny/python-pptx/issues/192#issuecomment-1036029544
Can we delete row from existing table from pptx developed by Python-Pptx.
I want to delete last 7th row from table. Is there anyway to do it?
And if we have use below function could you please provide any example of code for the same.
def remove_row(table: Table, row_to_delete: _Row) -> None: table._tbl.remove(row_to_delete._tr)
OR
def remove_row(table, row): tbl = table._tbl tr = row._tr tbl.remove(tr)
row = table.rows[n] remove_row(table, row)
Thank you
Originally posted by @VaishnaviDaware in https://github.com/scanny/python-pptx/issues/192#issuecomment-1036029544