border not properly applied to table nested within div when border-collapse: collapse is applied

RESOLVED DUPLICATE of bug 155955

Status

()

RESOLVED DUPLICATE of bug 155955
13 years ago
5 years ago

People

(Reporter: jim, Unassigned)

Tracking

({testcase})

1.8 Branch
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

try the following code in Firefox: 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<style>
td { border: 1px solid red; }
</style>
<body>
<div style="width:100%; border: 1px solid blue;">
<table style="width:100%; border-collapse: collapse; border: 1px solid pink;">
<tr>
  <td style="text-align:center;">HI</td>
</tr>
</table>
</div>
</body>
</html>

notice that the blue DIV border only appears on the right and bottom sides of the table, rather than all the way around. If you change border-collapse: collapse to border-collapse: separate, the borders/padding work as expected (though it introduces space between the borders that I'm trying to avoid by collapsing my borders). Also, if you remove the DOCTYPE specification and run in quirks mode, the borders appear as expected. Adding padding-left: 1px; and padding-top: 1px to the table also makes the table render properly, but only in Firefox.

Reproducible: Always

Steps to Reproduce:
1. specify a DOCTYPE of HTML 4.01 Transitional
2. nest a table, with individual cell borders and border-collapse:collapse, inside a DIV that also has a border.


Actual Results:  
DIV border appears only on the right and bottom of the nested table

Expected Results:  
DIV border should go all the way around the nested table.

Updated

13 years ago
Component: General → Layout: Tables
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → 1.8 Branch
(Reporter)

Comment 1

12 years ago
I'm still grappling with this bug. Can someone please at least confirm that I am in fact seeing a bug, not just incorrect about the w3c spec?
It's probably a duplicate, that's why I didn't confirm it, but it's definitely a bug in Mozilla.
Using border-spacing:0; instead of border-collapse should make it work the way you want.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Whiteboard: DUPEME

Comment 4

11 years ago
I think this is a duplicate of Bug 155955. It covers the same cases as 287011, 291104 & 291147. Which are all marked as duplicates of that bug.

Updated

10 years ago
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 155955

Updated

5 years ago
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.