[TESTCASE] khtml and table widths

Ladislav Strojil Ladislav.Strojil at seznam.cz
Thu Jul 18 17:21:21 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 18 July 2002 17:55, Dirk Mueller wrote:
> On Don, 18 Jul 2002, Michael Ritzert wrote:
> > is KHTML currently conforming to the CSS2 table layout algorithm as
> > described in http://www.w3.org/TR/REC-CSS2/tables.html#auto-table-layout
> > ? Or isn't this the issue at hand here?
>
> Not an issue. This is about malformed (i.e. overconstrained) tables, like
> those from KMail, which set 100% on every column. when there is more than
> one column, there is no algorithm in the whole wild world that can achieve
> that each column gets 100% width.
>
> Anyway, my commits were marked as EXPERIMENTAL.

Yep, I think we all understand this. 

Well, I the sum of widths is more than 100%, all the widths should be 
multiplied by 100/the_sum.
If it is less, then if should be multiplied by 100/the_sum only if there is no 
column without specified width.

So 
<table style="width: 100%">
<tr>
<td style="width: 80%">A</td>
<td style="width: 80%">B</td>
<td style="width: 40%">C</td>
</tr>
</table>
would produce table with
40% 40% 20%

and 
<table style="width: 100%">
<tr>
<td style="width: 80%">A</td>
<td>B</td>
<td>C</td>
</tr>
</table>
would produce table with
80% 10% 10%

but 
<table style="width: 100%">
<tr>
<td style="width: 20%">A</td>
<td style="width: 20%">B</td>
<td style="width: 40%">C</td>
</tr>
</table>
would produce table with
25% 25% 50%

Would this be OK? I don't know how is the layout of columns without width 
calculated. Is is possible to calculate width of all columns without width 
specified and then take the space that is left, take the sum of the 
percentages and do
if (column(s) without width exist(s)) {
	if (sum<100) try to give each column what it asked for
	else divide space left into parts based on ratios of the percentages
} else {
	coef=100/sum;
	use width*coef for each column.
}

Cheers,
Lada


- -- 
    ~       Ladislav Strojil, MFF UK
  ' v '               
 //   \\              
/(     )\    Powered by Penguin.
  ^ ' ^
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9NusCTnMZPFqq4nwRAhzXAKClz3Yl2Wq2BhzgZiQa0USXsF3Y7QCcDgxg
WFdCcRnI0o4egySosRwx1kE=
=8PU8
-----END PGP SIGNATURE-----





More information about the kfm-devel mailing list