Open Samuel-Muldoon opened 2 years ago
Something like this would suffice
import pptx
from pptx import *
def remove_row(table, row):
tbl = table._tbl
tr = row._tr
tbl.remove(tr)
# Establish read path
in_file_path = "input.pptx"
# Open slide-show presentation
pres = Presentation(in_file_path)
# Get Table
for slide in pres.slides:
for shp in slide.shapes:
if shp.has_table:
table = shp.table
row = table.rows[7]
remove_row(table, row)
pres.save("output.pptx")
Hi bowespublishing Can you provide, how we can do the same process for columns?
Related: #895
Suppose that we have a table. How would we delete a row from it?
After we have a reference to a
table
object, how do we delete a particular row?