From 362a6000b4cac49ea7bbbdb678d7cdd7c93de62c Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 6 Aug 2005 22:29:30 +0000 Subject: [project @ 2005-08-06 22:29:30 by bursa] Use given width as initial min/max width of fixed-width table columns. This improves the layout of certain tables with colspans. svn path=/import/netsurf/; revision=1841 --- render/layout.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'render/layout.c') diff --git a/render/layout.c b/render/layout.c index dc1111d70..3f8d87320 100644 --- a/render/layout.c +++ b/render/layout.c @@ -2159,8 +2159,13 @@ void layout_minmax_table(struct box *table) if (table->max_width != UNKNOWN_MAX_WIDTH) return; - for (i = 0; i != table->columns; i++) - col[i].min = col[i].max = 0; + /* start with 0 except for fixed-width columns */ + for (i = 0; i != table->columns; i++) { + if (col[i].type == COLUMN_WIDTH_FIXED) + col[i].min = col[i].max = col[i].width; + else + col[i].min = col[i].max = 0; + } /* border-spacing is used in the separated borders model */ if (table->style->border_collapse == CSS_BORDER_COLLAPSE_SEPARATE) -- cgit v1.2.3