(*** This bug was imported into bugs.kde.org ***) Package: khtml Version: 3.0 (using KDE 2.1.0 ) Severity: normal Installed from: SuSE Compiler: gcc version 2.95.2 19991024 (release) OS: Linux 2.4.0 i686 OS/Compiler notes: Apparently setting "height: 100%" doesn't work for tables inside tables. Here's an example: <!-- This table correctly takes up 100% of the page height --> <table style='height: 100%; border: 1px solid black'> <tr> <td style='height: 100%'> <!-- This table does not take up 100% of the td even though it should. --> <table style='height: 100%; border: 1px solid black'> <tr> <td> Content </td> </tr> </table> </td> </tr> </table> (Submitted via bugs.kde.org) (Called from KBugReport dialog)
It seems this bug is still open. I just tried to use the same code as described above. It works in IE, it works in Mozilla, but it doesn't work in Konqueror. May someone please reopen this bug? Thanks, Michael
Sorry, I forgot something... Konqueror 3.1 / Debian
OK, I'm reopening as I can reproduce as well, but one note on this: I am not sure why this was closed since the info was lost during the bug system migration; could have been a duplicate...
URL to reproduce as still OPEN (tested with KDE 3.0.3 on RH 8 and 3.1.1 on Gentoo): http://www.arnolddesign.ch/de/kontakt_email.php
I think we have globaly a problem with the rendering of Percentage Units in Tables and sometimes for tables, too. Here was a side, too, where we don't render the table correctly, too. http://www.w3.org/Style/CSS/Test/CSS1/current/sec62.htm I thnk the table must be on this side width=100%!! Sven
*** Bug 49099 has been marked as a duplicate of this bug. ***
there are quite some reports about that.
*** Bug 42014 has been marked as a duplicate of this bug. ***
Created an attachment (id=5315) [details] testcase interesting, WHAT doesn't have the 100% here
testcase uses the css style= tag instead of plain old <table height="100%"> which is the reason for this bug.
I see this problem with or without CSS. I'm glad I found this bug report. I thought I was going crazy.
Hi, I tried with last kde release on a slackware, tables have the same problem with the same code. Regards
This bug is now more than 3 years old. Congratulation to the KDE Team :-)
Replaced jonas@eisenstein.dk with fontana@netw.it due to bounces by reporter
Not sure if this is the same bug, but it's a similar tables issue at least. Pricewatch.com does not render correctly, to mention a big one, and there are other misc. sites where tables are screwed up!
*** Bug 43753 has been marked as a duplicate of this bug. ***
I just stomped on this bug. If the nested table has style="height: 100%", the sourounding table cell shrinks to the size of the nested table, regardless of the height of the outer table or other cells. This happens on both konqueror on SuSE 9.1 and Safari on OS X, so I suggest to set the plattform to all since this seems to be a general KHTML issue.
Created an attachment (id=7442) [details] proposed patch The two diff files patches two khtml files. The html_tableimpl.diff file introduces the height attribute for the <TD> element to be managed; The render_table.diff file introduces the lines that calculates the height of the table if this element is inside a <TD>.
(From update of attachment 7442 [details]) The patch was created for the KDE3.3
The posted patch is empty.
I tried to open the file and everything was right. The file contains the diff data.
the attachment contains only the filename
> the attachment contains only the filename No it doesn't... it contains a non-standard diff. KWrite bug?
*** Bug 76759 has been marked as a duplicate of this bug. ***
*** Bug 89418 has been marked as a duplicate of this bug. ***
(From update of attachment 7442 [details]) the mimetype was wrong
Created an attachment (id=7937) [details] Repost of the diff files I'm reposting the patch. In this case the file is a .tar.gz It includes both diff files.
CVS commit by carewolf: Merging selected table-layout changes from Webcore/146 BUG: 22657 M +5 -0 ChangeLog 1.305 M +33 -23 rendering/render_table.cpp 1.262 --- kdelibs/khtml/ChangeLog #1.304:1.305 @@ -1,2 +1,6 @@ +2004-10-18 Allan Sandfeld Jensen <kde@carewolf.com> + + * rendering/render_table.cpp: Merge layout fixes from Webcore + 2004-10-17 Stephan Kulow <coolo@kde.org> @@ -5,4 +9,5 @@ 2004-10-16 Allan Sandfeld Jensen <kde@carewolf.com> + * html/html_formimpl.cpp: Escape otherwise unencodable characters. Matches the behavior of Gecko. --- kdelibs/khtml/rendering/render_table.cpp #1.261:1.262 @@ -213,5 +213,4 @@ void RenderTable::calcWidth() m_width = style()->width().minWidth( availableWidth ); if(m_minWidth > m_width) m_width = m_minWidth; - //kdDebug( 6040 ) << "1 width=" << m_width << " minWidth=" << m_minWidth << " availableWidth=" << availableWidth << " " << endl; } else { m_width = KMIN(short( availableWidth ),m_maxWidth); @@ -227,4 +226,5 @@ void RenderTable::calcWidth() m_width = KMAX (m_width, m_minWidth); + // Finally, with our true width determined, compute our margins for real. m_marginRight=0; m_marginLeft=0; @@ -286,11 +286,21 @@ void RenderTable::layout() } - m_height += borderTop(); + int bpTop = borderTop(); + int bpBottom = borderBottom(); + + m_height += bpTop; + + int oldHeight = m_height; + calcHeight(); + int newHeight = m_height; + m_height = oldHeight; // html tables with percent height are relative to view Length h = style()->height(); - int th=0; - if (h.isFixed()) - th = h.value(); + int th = -(bpTop + bpBottom); // Tables size as though CSS height includes border/padding. + if (isPositioned()) + th = newHeight; // FIXME: Leave this alone for now but investigate later. + else if (h.isFixed()) + th += h.value(); else if (h.isPercent()) { RenderObject* c = containingBlock(); @@ -301,16 +311,22 @@ void RenderTable::layout() Length ch = c->style()->height(); if (ch.isFixed()) { - th = h.width(ch.value()); + th += h.width(ch.value()); break; } } - if (!c->isTableCell()) { + if (c->isTableCell()) { + RenderTableCell* cell = static_cast<RenderTableCell*>(c); + int cellHeight = cell->cellPercentageHeight(); + if (cellHeight) + th += h.width(cellHeight); + } + else { Length ch = c->style()->height(); if (ch.isFixed()) - th = h.width(ch.value()); + th += h.width(ch.value()); else { // we need to substract out the margins of this block. -dwh - th = h.width(viewRect().height() - c->marginBottom() - c->marginTop()); + th += h.width(viewRect().height() - c->marginBottom() - c->marginTop()); // not really, but this way the view height change // gets propagated correctly @@ -351,6 +367,5 @@ void RenderTable::layout() } - - m_height += borderBottom(); + m_height += bpBottom; if(tCaption && tCaption->style()->captionSide()==CAPBOTTOM) { @@ -361,8 +376,4 @@ void RenderTable::layout() //kdDebug(0) << "table height: " << m_height << endl; - calcHeight(); - - //kdDebug(0) << "table height: " << m_height << endl; - // table can be containing block of positioned elements. // ### only pass true if width or height changed. @@ -1238,5 +1248,5 @@ int RenderTableSection::layoutRows( int // qDebug("layoutRows: totalHeight = %d", totalHeight ); - int dh = totalHeight-rowPos[totalRows]; + int dh = toAdd; int totalPercent = 0; int numVariable = 0;
You need to log in before you can comment on or make changes to this bug.