diff --git a/weasyprint/formatting_structure/boxes.py b/weasyprint/formatting_structure/boxes.py index fa9590e5f..1a71ef93e 100644 --- a/weasyprint/formatting_structure/boxes.py +++ b/weasyprint/formatting_structure/boxes.py @@ -371,9 +371,14 @@ def get_wrapped_table(self): def page_values(self): start_value, end_value = super(ParentBox, self).page_values() if self.children: - start_box, end_box = self.children[0], self.children[-1] - start_value = start_box.page_values()[0] or start_value - end_value = end_box.page_values()[1] or end_value + if len(self.children) == 1: + page_values = self.children[0].page_values() + start_value = page_values[0] or start_value + end_value = page_values[1] or end_value + else: + start_box, end_box = self.children[0], self.children[-1] + start_value = start_box.page_values()[0] or start_value + end_value = end_box.page_values()[1] or end_value return start_value, end_value