 -                if (remainingLogicalHeight - footHeight < childLogicalHeight) {
 +
 +        for (int r = 0; r < totalRows; ++r) {
-+            int rowLogicalOffset = m_rowPos[r] + pageOffset;
-+            int remainingLogicalHeight = pageLogicalHeight - layoutState->pageLogicalOffset(rowLogicalOffset) % pageLogicalHeight;
++            m_rowPos[r] += pageOffset;
++            int remainingLogicalHeight = pageLogicalHeight - layoutState->pageLogicalOffset(m_rowPos[r]) % pageLogicalHeight;
++            int availableHeight = remainingLogicalHeight - footHeight - vspacing;
 +
 +            for (int c = 0; c < nEffCols; c++) {
 +                CellStruct& cs = cellAt(r, c);

         setLogicalHeight(logicalHeight() + section->logicalHeight());
         section = sectionBelow(section);
     }
@@ -521,7 +540,7 @@ void RenderTable::paintObject(PaintInfo& paintInfo, int tx, int ty)
         // re-paint header/footer if table is split over multiple pages
         if (m_head) {
             IntPoint childPoint = flipForWritingMode(m_head, IntPoint(tx, ty), ParentToChildFlippingAdjustment);

             } else {
                 rHeight = m_rowPos[rindx + cell->rowSpan()] - m_rowPos[rindx] - vspacing;
             }
-- 
1.7.10

