The Table object has a way to add a row with add_row but no way to remove a row.
Here is a simple function that can be used to remove a table row...
def remove_row(table, row):
tbl = table._tbl
tr = row._tr
tbl.remove(tr)
there is no column._tc, so ho can we delete a column?
@retsyo Like in HTML, there is no explicit element representing a column. A table is a sequence of rows, each of which is a sequence of cells.
To delete a column n, delete the n-th cell in each row.
Note there is also a a:tblGrid/a:gridCol element for each "grid" column and you'll need to delete the right one of those too.
Also note that there is such a thing as a a:tc element, but it means "table cell" rather than table column.
A little more on these details is here:
http://python-pptx.readthedocs.io/en/latest/dev/analysis/shp-table.html
If there are merged cells in the table that may complicate matters.
So, presumably you just need to add a method to the Row class like this:
def remove(self):
self._parent._tbl.remove(self._tr)
Most helpful comment
Here is a simple function that can be used to remove a table row...