From 589b0bde0a07b3759eba854b4c2a5991a958f6c4 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Wed, 14 May 2003 16:01:32 +0000 Subject: [w3m-dev 03902] Re: table rendering * table.c (check_relative_width): check n_leftcell check w <= r From: Akinori Ito --- table.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'table.c') diff --git a/table.c b/table.c index e1fa6ba..f03bc60 100644 --- a/table.c +++ b/table.c @@ -1,4 +1,4 @@ -/* $Id: table.c,v 1.43 2003/05/13 17:20:33 ukai Exp $ */ +/* $Id: table.c,v 1.44 2003/05/14 16:01:32 ukai Exp $ */ /* * HTML table */ @@ -3525,10 +3525,18 @@ check_relative_width(struct table *t, int maxwidth) else n_leftcell++; } - if (w < r || (w == r && n_leftcell > 0)) { - cell->fixed_width[i] = -100 * r; + if (n_leftcell == 0) { + /* w must be identical to r */ + if (w != r) + cell->fixed_width[i] = -100*r; } else { + if (w <= r) { + /* make room for the left(width-unspecified) cell */ + /* the next formula is an estimation of required width */ + w = r*cell->colspan[i]/(cell->colspan[i]-n_leftcell); + cell->fixed_width[i] = -100*w; + } for (j = 0; j < cell->colspan[i]; j++) { if (rcolwidth[j + k] == 0) rcolwidth[j + k] = (w - r) / n_leftcell; -- cgit v1.2.3