Permalink
Browse files

Avoid a division by 0 in static layout for tables

  • Loading branch information...
liZe committed Apr 16, 2012
1 parent 8bb2d56 commit efa01839e68662e668cfd72bdc6fb94aec4827d7
Showing with 4 additions and 3 deletions.
  1. +4 −3 weasyprint/layout/tables.py
@@ -300,9 +300,10 @@ def fixed_table_layout(box):
columns_without_width.append(j)
else:
width -= column_widths[j]
- width_per_column = width / len(columns_without_width)
- for j in columns_without_width:
- column_widths[j] = width_per_column
+ if columns_without_width:
+ width_per_column = width / len(columns_without_width)
+ for j in columns_without_width:
+ column_widths[j] = width_per_column
i += cell.colspan
# Distribute the remaining space equally on columns that do not have

0 comments on commit efa0183

Please sign in to comment.