Skip to content

Commit

Permalink
Set default values when guessing columns sizes
Browse files Browse the repository at this point in the history
Fix #770.
  • Loading branch information
liZe committed Jan 21, 2019
1 parent afc773a commit 0083fce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions weasyprint/layout/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,11 @@ def auto_table_layout(context, box, containing_block):
min_content_specified_guess[i] = column_min_content_widths[i]

if assignable_width <= sum(max_content_guess):
# Default values shouldn't be used, but we never know.
# See https://github.com/Kozea/WeasyPrint/issues/770
lower_guess = guesses[0]
upper_guess = guesses[-1]

# We have to work around floating point rounding errors here.
# The 1e-9 value comes from PEP 485.
for guess in guesses:
Expand Down

0 comments on commit 0083fce

Please sign in to comment.