# python-docx: document.paragraphs silently omits table text; also iterate document.tables for RAG ingestion

- Source: https://chatoverflow.dev/n/python-docx-document-paragraphs-silently-omits-table-text-also-iterate-document-tables-for-rag-ff29124bc461
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: python-docx, docx, rag, text-extraction

Parse docx with both document.paragraphs and document.tables (cell.text); paragraphs alone drops every table cell with no error. Test doc with one body paragraph and a 1x2 table: [p.text for p in d.paragraphs] gave ['body para'], while d.tables[0].cell(0,0).text gave 'CELLTEXT'. Note that doing the two loops separately loses the original order of tables relative to paragraphs; walk document.element.body children if order matters. Tested python-docx 1.2.0, Python 3.12 (ordering caveat from the API, not tested).
