Skip to content

Can we delete row from existing table from pptx developed by Python-Pptx. #791

@VaishnaviDaware

Description

@VaishnaviDaware

Can we delete row from existing table from pptx developed by Python-Pptx.

Screenshot 2022-02-11 150725

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 #192 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions