the latest version of CSS2.1 that got published today changes the margins on captions, lovely isn't it? => the code should be changed. While it is changed, it would be cool to clean up the code that I wrote for bug 3166. This will happen somewhere in august/sept.
Note that the behaviour you do now will be kept for CSS3, as noted in the draft. So don't delete your code. :-)
*** Bug 300624 has been marked as a duplicate of this bug. ***
*** Bug 309714 has been marked as a duplicate of this bug. ***
Is that also responsible for caption not being centered together with its table like here: <table style="margin:auto;"> <caption>Caption</caption> ... </table>
*** Bug 330189 has been marked as a duplicate of this bug. ***
Created attachment 290603 [details] Testcase for table caption margins Firefox is not conform to CSS 2.1. My testcase contains two floating tables with captions and margins. The first table has a real caption. The second table has a simulated caption by a <th rowspan="2">. On CSS 2.1 conform browsers both captions should look identical. Internet Explorer 6 and Opera 9 display the caption conform to CSS 2.1. Firefox is not conform to CSS 2.1 and display the caption conform to the old CSS 2.0.
> caption not being centered together with its table > like here: > <table style="margin:auto;"> > <caption>Caption</caption> Clarification needed. As far as I understand this, Firefox 2.x is compliant with CSS 2.0. Where does CSS 2.1 say or suggest or claim that captions do not have or can not have horizontal margins, distinct and separate from the table element? I do read "Captions have their own margins." bug 244848, comment #3 "This makes centering the table easy: just set both table margins and the outer caption margin to auto. (...) It is not possible to center the table and its caption together as a unit in this model." Mozilla's Caption Model http://fantasai.inkedblade.net/style/discuss/captions/ Many bugs have been resolved as invalid because of the fact that caption have horizontal margins, distinct (working separately) from the table. I can not see where this has changed in CSS 2.1. Current CSS 2.1 (July 17th 2007) does not prohibit what Mozilla do.
"captions have their own margin" bug 295089, comment #5 CSS 2.1, section 8.3 Margin properties (margin-right, margin-left) says: " Applies to: all elements except elements with table display types other than table-caption, table and inline-table Inherited: no " http://www.w3.org/TR/CSS21/box.html#margin-properties So caption have distinct, separate margin-left and margin-right and they are not inherited from the table element. In other words, in my understanding, what Firefox 2 does is still compliant with CSS 2.1.
What says that the caption's margins go inside the table's is that: # The width of the anonymous box is the border-edge width of the table box # inside it, as described by section 17.5.2. --http://www.w3.org/TR/CSS21/tables.html#model At least partly fixed by bug 363248; still needs a lot more testing of margins.
Summary: css 2.1 did change caption margins → css 2.1 changed caption margins
Fixed by bug 478614. The remaining issues are filed as bug 87277 and bug 372303.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.