Closed Bug 293052 Opened 19 years ago Closed 11 years ago

colspan displays table incorrectly

Categories

(Core :: Layout: Tables, defect)

1.0 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: ankurp, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(5 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

load the following html in mozilla and compare the span of the first column to
the same html loaded in ie or any html utility.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<table width="100%"  border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="3">&nbsp;</td>
    <td colspan="9" rowspan="2">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" rowspan="2">&nbsp;</td>
    <td colspan="10" rowspan="2">&nbsp;</td>
    <td colspan="2" rowspan="2">&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>
</table>
</body>
</html>


Reproducible: Always

Steps to Reproduce:
load above html into firefox.
Actual Results:  
the colspan was displayed incorrectly and the first cell did not span three columns.

Expected Results:  
span correctly.
(In reply to comment #0)
Actually, it renders different in Firefox, Opera and IE
I don't know which one is right though.
Component: General → Layout: Tables
Keywords: testcase
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → 1.0 Branch
IE display that table structure correctly.  The first cell in the first row
should span 3 columns.

(In reply to comment #2)
> (In reply to comment #0)
> Actually, it renders different in Firefox, Opera and IE
> I don't know which one is right though.

The cells in that table doesnt sum up correclty, how about attaching one that is
correct?
They do add up properly, please take the rowspans into account, view the file in
IE to see what the table should look like.  Each row has 19 columns.


(In reply to comment #4)
> The cells in that table doesnt sum up correclty, how about attaching one that is
> correct?

Whiteboard: DUPEME
Is it possible to reduce the testcase further?, it might be a dupe of bug 187550
Ankur/Reporter appears to be gone.
bug 187550 be the dup, or it could be a bug earlier than that.
Depends on: 187550
Attached file Another example
This is one row stripped down from a year schedule to read the Bible. Notice how Hosea and Amos are the wrong size in Firefox compared to Safari/IE.
This simplified testcase reveals that it isn't a bug, merely an edge case that isn't handled as the reporter expected.

The colspans are arranged in such a way that any content that would have appeared in the middle column is allowed to flow into one of the neighboring columns. Hence, the middle column can collapse to 0 width.

There are two ways around this. Either add formatting instructions (inline HTML or via stylesheets) to force the empty column to maintain a specific width, or else make sure the table has a row with some content in the middle column only, so that it can't collapse with neighboring columns.
Another example of the collapsing cells effect. View it side-by-side in another browser (I used Opera) to see the differences. It's also quite informative to comment out various portions of the embedded CSS and observe how it affects the rendering.
It's a bug here is a simplistic code example that shows it's not working correctly.  Run this same html against Firefix 2.+ and it works as you would expect. 

Output should look like this:

ROOT
1 SUBDATA
1 1 SUBDATA
1 1 1 SUBDATA 

Firefox 3.+ showing this:

ROOT
1 SUBDATA
1 1   SUBDATA
1 1   1      SUBDATA


HTML EXAMPLE:

<HTML>
<Body>
<H3> COLSPAN - PROBLEM introduced in Firefox 3 </H3>
<TABLE>
<TR>
<TD COLSPAN=20>ROOT</TD>
</TR><TR>
<TD>1</TD>
<TD COLSPAN=20>SUBDATA</TD>
</TR><TR>
<TD>1</TD>
<TD>1</TD>
<TD COLSPAN=20>SUBDATA</TD>
</TR><TR>
<TD>1</TD>
<TD>1</TD>
<TD>1</TD>
<TD COLSPAN=20>SUBDATA</TD>
</TABLE>
</BODY>
</HTML>
whats the difference between comment 12 and https://bugzilla.mozilla.org/show_bug.cgi?id=75061#c10 ?
Nothing, As they may be related to the same core problem.  I found bug # 75061 later and decided to add it there as well.  I didn't want to create a new bug.
I created a new thread for Comment #10 - Bug 505655
IGNORE #15 - I created a new thread for sorry #12 (not #10) - Bug 505655.
I found what I think is the simplest case of this problem by accident today. Using the following code, all with fixed width, the two colspan=3 cells should overlap by 200px. Instead, in Firefox, they abut diagonally.

<table cellspacing='3' border='1' style='width: 600px;'>
	<tr>
		<td style='width: 100px;'>100px</td>
		<td colspan='3' style='width: 300px;'>colspan 3</td>
		<td style='width: 100px;'>100px</td>
		<td style='width: 100px;'>100px</td>
	</tr>

	<tr>
		<td style='width: 100px;'>100px</td>
		<td style='width: 100px;'>100px</td>
		<td colspan='3' style='width: 300px;'>colspan 3</td>
		<td style='width: 100px;'>100px</td>
	</tr>
</table>

If you move the last colspan=3 column to the end, you can see that the 100px cells above and below the colspan=3 columns are being stretched to fill space, rather than the colspan=3 cells correctly overlapping.
still getting the bug with FF 14
Still getting the bug with FF 17. If you look at the following page:

http://neilb.org/table-bug/index.html

This has a simple example illustrating the bug, and images showing how it renders in a number of browsers. Chrome, Safari, and Sleipnir all handle it as I expected.

Firefox, Opera, Camino and IE all have broken rendering.
Seems fixed to me, using FF28.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: