diff --git a/tests/draw/test_table.py b/tests/draw/test_table.py
index c53e32949..d253a676c 100644
--- a/tests/draw/test_table.py
+++ b/tests/draw/test_table.py
@@ -1198,3 +1198,40 @@ def test_tables_20(assert_pixels):
|
|
''')
+
+
+@assert_no_logs
+def test_tables_21(assert_pixels):
+ assert_pixels('''
+ _________________________
+ _rrrrrrrrrrrrrrrrrrrrrrr_
+ _rBBBBBBBBBBrBBBBBBBBBBr_
+ _rBKKKKKKBBBrBKKKKKKBBBr_
+ _rBKKKKKKBBBrBKKKKKKBBBr_
+ _rBBBBBBBBBBrBBBBBBBBBBr_
+ _rrrrrrrrrrrrrrrrrrrrrrr_
+ _________________________
+ _________________________
+ _________________________
+ _________________________
+ _________________________
+ _rrrrrrrrrrrrrrrrrrrrrrr_
+ _rBBBBBBBBBBrBBBBBBBBBBr_
+ _rBKKKKKKBBBrBBBBBBBBBBr_
+ _rBKKKKKKBBBrBBBBBBBBBBr_
+ _rBBBBBBBBBBrBBBBBBBBBBr_
+ _rrrrrrrrrrrrrrrrrrrrrrr_
+ _________________________
+ _________________________
+ _________________________
+ _________________________
+ ''', '''
+
+
+ abc | abc |
+ abc | |
''')
diff --git a/weasyprint/layout/table.py b/weasyprint/layout/table.py
index 086242577..edc05b51e 100644
--- a/weasyprint/layout/table.py
+++ b/weasyprint/layout/table.py
@@ -272,17 +272,11 @@ def group_layout(group, position_y, bottom_space, page_is_empty,
# Break if one cell was broken
break_cell = False
if resume_at:
- values, = list(resume_at.values())
- if len(row.children) == len(values):
- for cell_resume_at in values.values():
- if cell_resume_at != {0: None}:
- break_cell = True
- break
- else:
- # No cell was displayed, give up row
- next_position_y = inf
- page_is_empty = False
- resume_at = None
+ if all(child.empty for child in row.children):
+ # No cell was displayed, give up row
+ next_position_y = inf
+ page_is_empty = False
+ resume_at = None
else:
break_cell = True