docling-project / docling-project/docling

Tables in PDF: parsed table element contains many duplicated cells when .export_to_dataframe()

Open
#2,862 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug

When parsing a PDF with tables, sometimes the resulted table element can contain many duplicated cells (or columns) when converting to Pandas Dataframe with .export_to_dataframe().

Same observation when converting to Markdown table.

### Steps to reproduce
The attached PDF contains this issue (the table is on page 35).

[CVS Group PLC_4295896578_2025_ann report.pdf](https://github.com/user-attachments/files/24512184/CVS.Group.PLC_4295896578_2025_ann.report.pdf)

The attached .ipynb contains the code to reproduce this issue.
- TableFormerMode.ACCURATE: lots of duplicates
- TableFormerMode.FAST: fewer duplicates
- TableFormerMode.ACCURATE + Disable Cell Matching: lots of duplicates

[pdf_duplicated_cells.ipynb](https://github.com/user-attachments/files/24512219/pdf_duplicated_cells.ipynb)

### Docling version

- Docling version: 2.66.0
- Docling Core version: 2.58.0
- Docling IBM Models version: 3.10.3
- Docling Parse version: 4.7.2
- Python: cpython-312 (3.12.12)
- Platform: Windows-11-10.0.26200-SP0

Same issue can be also replicated in Mac OS.

### Python version

Python 3.12.12

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.