Closed ebruchez closed 3 weeks ago
The issue is that the first cell of the first grid of the first section has an h="2"
.
It's easy to add h="2"
: add grid row, expand cell down.
The HTML produced for the PDF renderer has a rowspan="2"
:
<table class="fr-grid fr-grid-1 fr-grid-grid-1 fr-norepeat" role="presentation">
<tbody class="fr-grid-body">
<tr class="fr-grid-tr">
<td id="section-1-section≡grid-1-grid≡xf-772" class="fr-grid-td xforms-group" rowspan="2">
CONTENT
</td>
</tr>
</tbody>
</table>
<div class="fr-grid-non-empty" id="section-1-section≡grid-1-grid≡xf-781"/>
The grid model looks like this:
GridModel(
List(
List(Cell(Some(org.orbeon.saxon.tinytree.TinyElementImpl@22704002), None, 1, 1, 2, 1)),
List(
Cell(
Some(org.orbeon.saxon.tinytree.TinyElementImpl@22704002),
Some(Cell(Some(org.orbeon.saxon.tinytree.TinyElementImpl@22704002), None, 1, 1, 2, 12)),
1,
2,
1,
1
)
)
)
)
But we only keep the None
s, so we get:
[
(
{
"c": "org.orbeon.saxon.tinytree.TinyElementImpl@22704002",
"x": 1,
"y": 1,
"h": 2,
"w": 1
}
}
),
()
]
Since #5260, we don't output the <tr>
if there are no cells in that row. This is why there is no second <tr>
.
Interestingly, #5260 was about an error caused exactly in this scenario of a single cell spanning two rows. The solution chosen was to avoid trying to output the row <tr>
, but this messes up the rowspan
s. So it's better to output the <tr>
but not output any <td>
if none needed.
+1 from customer