File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
docling_core/transforms/serializer Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 67
67
PictureTabularChartData ,
68
68
RichTableCell ,
69
69
SectionHeaderItem ,
70
- TableCell ,
71
70
TableItem ,
72
71
TextItem ,
73
72
TitleItem ,
@@ -347,9 +346,6 @@ def serialize(
347
346
** kwargs : Any ,
348
347
) -> SerializationResult :
349
348
"""Serializes the passed table item to HTML."""
350
- nrows = item .data .num_rows
351
- ncols = item .data .num_cols
352
-
353
349
res_parts : list [SerializationResult ] = []
354
350
cap_res = doc_serializer .serialize_captions (item = item , tag = "caption" , ** kwargs )
355
351
if cap_res .text :
@@ -359,10 +355,9 @@ def serialize(
359
355
body = ""
360
356
span_source : Union [DocItem , list [SerializationResult ]] = []
361
357
362
- for i in range ( nrows ):
358
+ for i , row in enumerate ( item . data . grid ):
363
359
body += "<tr>"
364
- for j in range (ncols ):
365
- cell : TableCell = item .data .grid [i ][j ]
360
+ for j , cell in enumerate (row ):
366
361
367
362
rowspan , rowstart = (
368
363
cell .row_span ,
You can’t perform that action at this time.
0 commit comments