Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docling_core/types/doc/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def grid(
]

# Overwrite cells in table data for which there is actual cell content.
count = 1
for cell in self.table_cells:
for i in range(
min(cell.start_row_offset_idx, self.num_rows),
Expand All @@ -361,7 +362,11 @@ def grid(
min(cell.start_col_offset_idx, self.num_cols),
min(cell.end_col_offset_idx, self.num_cols),
):
table_data[i][j] = cell
if count <= len(self.table_cells):
table_data[i][j] = cell
count += 1
else:
break

return table_data

Expand Down