Closed
Bug 250266
Opened 20 years ago
Closed 20 years ago
% padding-left doesn't work on p in a table cell
Categories
(Core :: Layout: Block and Inline, defect)
Core
Layout: Block and Inline
Tracking
()
People
(Reporter: matt, Unassigned)
References
()
Details
Attachments
(4 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 I am using the code <p style="padding-left: 15%" >to offest a paragraph but Firefox is offseting it. The paraph is still aligned to the left. If I change from a % value to a px value it works fine. Reproducible: Always Steps to Reproduce: 1.Create a <p> tag using the style="padding-left: 15%" css command 2. View file Actual Results: The <p> tag is not off set like it should be Expected Results: Off set the <p> tag
Updated•20 years ago
|
Assignee: firefox → nobody
Component: General → Layout
Product: Firefox → Browser
QA Contact: firefox.general → core.layout
Version: unspecified → Trunk
Comment 1•20 years ago
|
||
WFM 20040705 PC/Win2000
Comment 2•20 years ago
|
||
Comment 3•20 years ago
|
||
Just this snippet: <table><td><p style="padding-left: 15%">blah</p></td></table> makes the padding not happen. Not sure why that is, and if it's a correct interpretation of CSS (which is always dicey with tables) or not.
Summary: Firefox does not process padding-left when using a % value → % padding-left doesn't work on p in a table cell
Comment 4•20 years ago
|
||
From the CSS specification: "If the containing block's width depends on this element, then the resulting layout is undefined" http://www.w3.org/TR/CSS21/box.html#padding-properties In this case, the width of the table cell depends on the width of the paragraph. With the percentage padding-left on the paragraph, the paragraph width depends on the width of the table cell. That doesn't make much sense, and so the spec says that the the browser can do whatever it wants. Mozilla/Firefox are obviously doing it differently to IE, but this behaviour isn't wrong. You (assuming this is your site) should either set the padding in px, or set the width of the table cell explicitly.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 5•20 years ago
|
||
Yes, IE does display it offset. But one confuses me now is that if I set it so the style reads "style="text-align: center"" then Firefox does center the paragtrah in the table cell. Yes this is also my site, I just checked the CSS file and I do explicitly define the width of that table cell using the CSS command "width: 600px" so if I read the last entry for this possible bug then it was up to the browser how to display the padding if the width was not specified.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 6•20 years ago
|
||
Matt, could you please attach a testcase showing the bug, then? The "reduced site testcase" attached here has no width specified on anything.
Reporter | ||
Comment 7•20 years ago
|
||
I have atteched a simple table with a CSS width spefication of 600px (in the first td tage). The <p> tag in the table has padding-left: 15% CSS command
Comment 8•20 years ago
|
||
Confirming bug based on that testcase...
Status: UNCONFIRMED → NEW
Component: Layout → Layout: Tables
Ever confirmed: true
OS: Windows XP → All
QA Contact: core.layout → core.layout.tables
Hardware: PC → All
Comment 10•20 years ago
|
||
The block code does optimize the reflow for the text away during the resize reflow if the content will easily fit into the table. During the unconstrained initial reflow it does not know the width so it can't compute the percent padding. So it needs to reflow the text during the resize. It does reflow however if the text is long enough. Changing component
Component: Layout: Tables → Layout: Block and Inline
Comment 11•20 years ago
|
||
*** This bug has been marked as a duplicate of 30802 ***
Status: NEW → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•