Answers for "Using Python-docx to update cell content of a table"

2

Using Python-docx to update cell content of a table

doc = Document('filename.docx')
print(doc.tables)

table = doc.tables[0]
table.cell(0, 0).text = 'new value'

doc.save('filename_updated.docx')
Posted by: Guest on May-06-2022

Python Answers by Framework

Browse Popular Code Answers by Language