RetroZilla/layout/html/tests/table/bugs/bug1302.html
2015-10-20 23:03:22 -04:00

162 lines
4.5 KiB
HTML

<html><body>
<div align=center>
<hr>
<p><b>Tables I, II, III, IV (cellpadding=0 cellspacing=5)</b></p>
<table border cellpadding=5 bgcolor=ffcc00>
<tr><td valign=top>
<table border cellpadding=0 cellspacing=5 bgcolor=ffffff>
<caption><nobr>Table I</nobr></caption>
<tr>
<td>1,1</td><td>1,2</td><td>1,3</td><td>1,4</td><td>1,5</td>
</tr>
<tr>
<td>2,1</td><td>2,2</td><td>2,3</td><td>2,4</td><td>2,5</td>
</tr>
<tr>
<td>3,1</td><td bgcolor=ffff66>3,2</td><td bgcolor=ffff66>3,3</td><td bgcolor=ffff66>3,4</td><td>3,5</td>
</tr>
</table>
</td><td valign=top>
<table border cellpadding=0 cellspacing=5 bgcolor=ffffff>
<caption><nobr>Table II</nobr></caption>
<tr>
<td>1,1</td><td colspan=2>1,2</td><td>1,4</td><td>1,5</td>
</tr>
<tr>
<td>2,1</td><td>2,2</td><td colspan=2>2,3</td><td>2,5</td>
</tr>
<tr>
<td>3,1</td><td bgcolor=ffff66>3,2</td><td bgcolor=ffff66>3,3</td><td bgcolor=ffff66>3,4</td><td>3,5</td>
</tr>
</table>
</td><td valign=top>
<table border cellpadding=0 cellspacing=5 bgcolor=ffffff>
<caption><nobr>Table III</nobr></caption>
<tr>
<td>1,1</td><td colspan=2>1,2</td><td>1,4</td><td>1,5</td>
</tr>
<tr>
<td>2,1</td><td>2,2</td><td colspan=2>2,3</td><td>2,5</td>
</tr>
<tr>
<td>3,1</td><td bgcolor=ffff66></td><td bgcolor=ffff66></td><td bgcolor=ffff66></td><td>3,5</td>
</tr>
</table>
</td><td valign=top>
<table border cellpadding=0 cellspacing=5 bgcolor=ffffff>
<caption><nobr>Table IV</nobr></caption>
<tr>
<td>1,1</td><td colspan=2>1,2</td><td>1,4</td><td>1,5</td>
</tr>
<tr>
<td>2,1</td><td>2,2</td><td colspan=2>2,3</td><td>2,5</td>
</tr>
</table>
</td></tr></table>
</div>
<BR>
<p>
This is a table colspan counting problem (IMHO).
The oversize &lt;TABLE> has two rows: one has *two* &lt;TD>
"requesting" total of 3 columns to span; second row has *one* &lt;TD>
"requesting" total of 3 columns to span. In other words, it's asking
for one more column than the max number of 'real' elements in a row.
Here's the simple case (first one shows the problem; the other adjusts the
colspan values and it works) (Dec 19 Nightly Win 95): All the elements in
the two tables below are width=auto (i.e., no width attribute specified).
</p><br>
<TABLE CELLPADDING="3" CELLSPACING="0" border="1">
<TR>
<TD colspan="2"><P><b>This is colspan=2</b></P></TD>
<TD>Blah Blah Blah Blah Blah Blah</TD>
</TR>
<TR>
<TD colspan="3">
<p><b>This is colspan=3</b> blah blah blah blah blah
--- why doesn't this cell span the table (5.0 win95 jun17)?
</p>
</TD>
</TR>
</TABLE>
<br><br>
<TABLE CELLPADDING="3" CELLSPACING="0" border="1">
<TR>
<TD colspan="1"><P><b>This is colspan=1</b></P></TD>
<TD>Blah Blah Blah Blah Blah Blah</TD>
</TR>
<TR>
<TD colspan="2">
<p><b>This is colspan=2</b> blah blah blah blah blah
--- this cell spans the table correctly.
</p>
</TD>
</TR>
</TABLE>
<br><p>
Here's the test case from bug #2645.
</p><p>
This test case (below) is derived from home.netscape.com (although
not much is left). [This was the table structure for "Autos ... Local
..." and the right-hand column ("ABCNews.com..."); added an extra column
to differentiate this example a bit more from the one above].
</p><p>
The basic problem is "competing colspan requests". The table has two rows,
both of which have COLSPAN requests. They are both asking for one more column
than the max number of 'real' elements in either row (i.e., both ask for total
of 5 but the maximum number of TD in either row is 4). This seems to confuse the
algorithm. ;) (Note: all the column elements in these two tables are width=fixed
except the TD with colspan=(4|3)).
</p>
<TABLE WIDTH=680 border>
<TR>
<td width=80>x</td>
<TD WIDTH=400 COLSPAN=2> this (colspan=2)</TD>
<TD WIDTH=2 BGCOLOR="#99cccc"> blue </TD>
<TD WIDTH=198> that </TD>
</TR>
<TR>
<td width=80>x</td>
<TD COLSPAN=4 BGCOLOR="#99cccc"> blue (colspan=4) --- doesn't span (5.0 win95 jun17)</TD>
</TR></TABLE>
<br><p>
Here's the same table but the 'colspan' values have been normalized.
</p>
<TABLE WIDTH=680 border>
<TR>
<td width=80>x</td>
<TD WIDTH=400 COLSPAN=1> this (colspan=1)</TD>
<TD WIDTH=2 BGCOLOR="#99cccc"> blue </TD>
<TD WIDTH=198> that </TD>
</TR>
<TR>
<td width=80>x</td>
<TD COLSPAN=3 BGCOLOR="#99cccc"> blue (colspan=3) --- spans correctly</TD>
</TR></TABLE>
<BR>
</body></html>