python-pptx表格插入行

问题遇到的现象和发生背景
有没有一个方法可以在pptx原有的表格中插入行或者列,目前网上只有新增一个表!
问题相关代码,请勿粘贴截图

运行结果及报错内容

我的解答思路和尝试过的方法

我想要达到的结果

添加行列可参考如下代码:

from pptx import Presentation
from pptx.table import _Cell
import copy
prs = Presentation('t1221.pptx')
TAB = prs.slides[1].shapes[1].table
copy_idx=0
insert_idx=0
new_row = copy.deepcopy(TAB._tbl.tr_lst[copy_idx])
for tc in new_row.tc_lst:
    cell = _Cell(tc, new_row.tc_lst)
    cell.text = 'foobar'
TAB._tbl.append(new_row)
new_col = copy.deepcopy(TAB._tbl.tblGrid.gridCol_lst[-1])
TAB._tbl.tblGrid.append(new_col)  
# for tr in TAB._tbl.tr_lst:
#     # duplicate last cell of each row
#     new_tc = copy.deepcopy(tr.tc_lst[-1])
#     tr.append(new_tc)
#     # cell = _Cell(new_tc, tr.tc_lst)
#     # cell.text = 'bar'
prs.save('t1221.pptx')

https://stackoverflow.com/questions/64249427/using-python-pptx-package-to-append-a-table-row-will-add-a-row-that-when-edited