Skip to content

Commit ace2435

Browse files
committed
Support keepTogether at table level
DEVSIX-466
1 parent 09f86ad commit ace2435

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/TableRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ public LayoutResult layout(LayoutContext layoutContext) {
353353

354354
applyBorderBox(occupiedArea.getBBox(), true);
355355
applyMargins(occupiedArea.getBBox(), true);
356-
357-
int status = childRenderers.isEmpty() && footerRenderer == null ? LayoutResult.NOTHING : LayoutResult.PARTIAL;
356+
int status = (childRenderers.isEmpty() && footerRenderer == null) || getPropertyAsBoolean(Property.KEEP_TOGETHER)
357+
? LayoutResult.NOTHING
358+
: LayoutResult.PARTIAL;
358359
if (status == LayoutResult.NOTHING && getPropertyAsBoolean(Property.FORCED_PLACEMENT)) {
359360
return new LayoutResult(LayoutResult.FULL, occupiedArea, null, null);
360361
}

0 commit comments

Comments
 (0)