Commit 52c5bea
fix table to html bug (#203)
This PR fixes a bug where tables with cells that spans multiple rows can
cause the rows below/aligned with them position incorrectly. The
original code assumes the first cell from a row (i.e., the cell that
increments the row number) is also the first column. But for tables like
the one below (also in this PR as a new sample doc):

The last first 4 columns has headers spanning two rows but the last two
columns have headers that has two rows. With the current code the second
row (the subheaders) of the last two columns are treated as the
subheaders for the first two columns:

This PR fixes this bug by filling in cells with empty text to occupy the
cells at row 2, columns 1 through 4. Those are the cells that are
compounded into the header. And the resulting html represents the table
structure better:

---------
Co-authored-by: Cloud User <[email protected]>1 parent 7cd724a commit 52c5bea
File tree
4 files changed
+55
-6
lines changed- test_unstructured_inference/models
- unstructured_inference
- models
4 files changed
+55
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
| |||
595 | 593 | | |
596 | 594 | | |
597 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
598 | 624 | | |
599 | 625 | | |
600 | | - | |
601 | | - | |
| 626 | + | |
602 | 627 | | |
603 | 628 | | |
604 | 629 | | |
| |||
0 commit comments