We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppose that we have a table. How would we delete a row from it?
import pptx from pptx import * # Establish read path in_file_path = "C:\\Users\\user\\Desktop\\power_point_pres.pptx" # Open slide-show presentation pres = Presentation(in_file_path) # Get Table slide = next(iter(pres.slides)) shp = next(iter(slide.shapes)) table = shp.table
After we have a reference to a table object, how do we delete a particular row?
table
The text was updated successfully, but these errors were encountered:
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")
Sorry, something went wrong.
Hi bowespublishing Can you provide, how we can do the same process for columns?
Related: #895
No branches or pull requests
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?The text was updated successfully, but these errors were encountered: