Handle merged cells in PDF table extraction
9 November 2025
Copy a shared category label onto each row it genuinely describes. Do not copy a merged numeric value into several amount fields unless the source establishes that each field has that value. The shape of a merged cell does not decide its meaning.
Identify what the span represents
Suppose a PDF table shows “Maintenance” beside three item rows. The heading spans their combined height. Another source cell displaying 50 units spans two adjacent columns. It is unclear from the cell's position whether the figure is a group allowance, a unit price or a line amount.
| Source feature | Normalised representation | Check |
|---|---|---|
| Maintenance spans three rows | Give each of those item rows the same category label and retain the source span. | The label describes all three and stops at the next category. |
| One numeric value spans two columns | Store the observed 50 once, with its original headers and source location. | Assign a semantic field only after checking the row, headers and any note. |
| A formerly covered or empty cell | Leave it empty or explicitly marked as covered where appropriate. | Do not turn missing evidence into a zero. |
If a downstream import writes 50 twice into additive amount rows, it will sum 100 even though the source supplies one quantity. A database can accidentally double-count repeated context as easily as it can lose context.
Keep a reversible mapping
Keep the raw extraction, page number, table identifier, source bounds and the stable target row IDs. When propagating a category, record the original spanning cell once and link the relevant rows to it. A normalised example can illustrate the shape of the output without settling what a different table's ambiguous value means. Example normalised extraction
Ask a reviewer to trace one category row and the shared numeric value back to the PDF. Compare line quantities and totals where the source defines the arithmetic. If two plausible interpretations remain, hold the affected field for clarification instead of deriving a new number.
Part of the How to catch wrong cells in a PDF table with the right total guide.
Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).
