Relative Content

Tag Archive for python-3.xpython-docx

Group a paragraph and a table so they don’t get split across pages

I am trying to add a caption for a table and then immediately after, add a table. Sometimes the table and caption get split across multiple pages because of table size, etc. Is there anything similar to https://python-docx.readthedocs.io/en/latest/api/text.html#docx.text.parfmt.ParagraphFormat.keep_together that can be used with both paragraphs and tables.