Ticket #8420 (closed bug: invalid)
.outerHeight misses CAPTION height when object is TABLE
| Reported by: | r.i.k@… | Owned by: | r.i.k@… |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | manipulation | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The computed height of a table with no rows but only a caption returns 0, missing the height of the caption.
Although W3C specifies that a table MUST have rows, dynamic manipulation can lead to a table with no rows but only a caption.
FYI, above is what I locally use to "overload" the .outerHeight method :
jQuery.fn.outerHeight = function(origMethod)
{
return function(args)
{
var h = origMethod.apply(jQuery(this), [args]) ;
if (this.get(0).tagName.toLowerCase() == 'table' && this.find('> caption').size() > 0)
{
h += origMethod.apply(this.find('> caption'), [args]) ;
}
return h ;
} ;
}(jQuery.fn.outerHeight);
Change History
comment:1 Changed 2 years ago by rwaldron
- Owner set to r.i.k@…
- Status changed from new to pending
- Component changed from unfiled to manipulation
comment:2 Changed 2 years ago by trac-o-bot
- Status changed from pending to closed
- Resolution set to invalid
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:3 Changed 21 months ago by tigrangab@…
I can confirm this: http://jsfiddle.net/tPtef/
It does not take into account the caption height.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!
Additionally, test against the jQuery 0 GIT version to ensure the issue still exists.