Closed
Bug 389668
Opened 17 years ago
Closed 17 years ago
TFOOT appears on every page when only THEAD set to display:table-header-group
Categories
(Core :: Layout: Tables, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: sbrecht, Unassigned)
References
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
I am encountering an issue where I have a long table formatted for printing (CSS media=print).
In the print stylesheet the THEAD is set for display:table-header-group; and the TBODY is set to display:table-row-group. This is designed to get a header to appear at the top of the columns on each printed page.
It appears that the TFOOT element inherits this property and also appears on every page. When using TFOOT to show a row of totals (column sums) this shows the total row on every page which is incorrect. IE 6 surprisingly renders this correctly putting the THEAD on every page and putting the TFOOT only on the last page. I have currently not found a viable work around in Firefox yet.
Reproducible: Always
Steps to Reproduce:
1. Create a long table with a THEAD and TFOOT
2. Set the THEAD to display:table-header-group
4. Set the TBODY to display:table-row-group
3. Print the table
Actual Results:
TFOOT will appear on every page
Expected Results:
TFOOT should only display with each column group (i.e. printed page) when it is explicitly set to display:table-footer-group; It should not inherit this from THEAD or TBODY.
Comment 1•17 years ago
|
||
Do you have a testcase you could attach? This might be worth testing on trunk, too, since there've been many layout fixes there. http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ I'd use a new profile to test. http://kb.mozillazine.org/Profile_Manager
Component: General → Layout: Tables
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → 1.8 Branch
Comment 2•17 years ago
|
||
Note that this is untestable on trunk currently; it is masked by bug 383195. Marking this as a dependency of that.
Depends on: 383195
Comment 3•17 years ago
|
||
The UA stylesheet has the following rule in this case:
tfoot {
display: table-footer-group;
vertical-align: middle;
}
See http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/style/html.css&rev=3.214#232
There's no inheriting going on; just UA style rules. Note that this particular rule is even in the (non-normative) default stylesheet for HTML attached to the CSS spec. See http://www.w3.org/TR/CSS21/sample.html
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 4•17 years ago
|
||
Colour me confused then... This doesn't seem right. My apologies if there is something I'm missing here.
So why does the output not change dependent on my use of table-footer-group ? If I set or don't set the property the printout results are exactly the same in FF. The TFOOT is at the bottom of every page. This doesn't make sense to me.
The table-footer-group property in IE controls if the footer is attached to each column group or just appears at the end of the output which seems logical. I would test this further in other browsers but Safari Win (only other available at the moment) ignores column grouping on printouts entirely.
My expected functionality would be (as displayed by IE):
tfoot { display: table-footer-group; }
Produces a foot at the bottom of every column group.
The lack of this propery produces a footer only at the end of the output.
Please confirm. I will post a test case shortly.
Comment 5•17 years ago
|
||
> If I set or don't set the property the printout results are exactly the same in
> FF.
It _defaults_ to table-footer-group in Firefox. Did you look at the URLs in comment 3. Setting it to that in author style changes nothing, of course. If you set it to table-row-group, it won't show up on every page.
Reporter | ||
Comment 6•17 years ago
|
||
Ahhh. So the correct question is *should* it default to this setting when CSS appears to have a setting to implicitly turn this option on.
The table-row-group work around isn't valid. According to W3 spec TFOOT tags should appear after the THEAD and before the TBODY. If you use table-row-group the tfoot now appears under the header at the top of the tbody contents with the table elements ordered properly. I have appended my demo below to show this.
http://www.autosoftsys.com/tfoottest/
The only way to achieve the desired output is to use table-row-group and then put the TFOOT after the TBODY which is against W3 rules.
http://www.w3.org/TR/html401/struct/tables.html#h-11.2.3
If display-foot-group is is a default in Firefox then I propose that it is an incorrect default. The CSS property is there to explicitly turn that option on.
Reporter | ||
Comment 7•17 years ago
|
||
My apologies for the bug-spam, this should be the end of it.
On further reading the spec does call for table-header-group and table-footer-group to be defaults. As such then the issue may lie with how Firefox renders a TFOOT element when it is placed before a TBODY (as per W3 spec) and the display is set to display:table-row-group. I have been unable to create the desired output (footer at the end only) putting THEAD, TFOOT, and TBODY in their proper order in Firefox. If desired I will file a new bug under this issue.
I leave it for your consideration. For the project in question for now I will put TFOOT after TBODY as an incorrect but managable work around.
Comment 8•17 years ago
|
||
In the CSS table model, the "position at the bottom" behavior and the "appear on multiple pages when printed" behavior are linked. You can't get one without the other. Now IE doesn't really implement the CSS table model; you can verify this easily by looking at what it does when setting <tfoot> to "display: block", for example.
Note that HTML5 will likely allow tfoot to come after tbody, precisely to address the sort of issues you're encountering.
You need to log in
before you can comment on or make changes to this bug.
Description
•