      if (!m_firstBody && computedLogicalHeight > totalSectionLogicalHeight && !document()->inQuirksMode()) {
          // Completely empty tables (with no sections or anything) should at least honor specified height
          // in strict mode.
-@@ -386,6 +402,9 @@ void RenderTable::layout()
+@@ -386,6 +406,9 @@ void RenderTable::layout()
          }
          section->setLogicalLocation(sectionLogicalLeft, logicalHeight());
  

+            }
+            if (m_firstBody) {
+                // FIXME: Calculate maximum required height across all cells in first body row
+                RenderTableCell* firstCell = m_firstBody->primaryCellAt(0, 0);
+                requiredHeight += firstCell->contentLogicalHeight() + firstCell->paddingTop(false) + firstCell->paddingBottom(false) + vBorderSpacing();
+            }
+            if (requiredHeight > remainingLogicalHeight) {
+                setPaginationStrut(remainingLogicalHeight);

                 // find actual end of table on current page
                 int dy = 0;
                 const int max_dy = info.rect.y() + info.rect.height();
diff --git a/src/qt/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp b/src/qt/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp
index 1e90ac6..611d209 100644
--- a/src/qt/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/src/qt/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp
@@ -496,26 +496,41 @@ int RenderTableSection::layoutRows(int toAdd, int headHeight, int footHeight)
 
     LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());
 
