'Internally used method to split the table across columns so that it
will fit into the available space on the page.'

def splitTable(self, tempTable):

    colWidths = tempTable._colWidths
    rowHeights = tempTable._rowHeights
    total = 0
    colNo = 0
    colSplit = []
    newColWidth = []
    pageColWidth = []
    for colW in colWidths:
        if ((colNo > 0) and ((total + colW) > self.tempDoc.printable_width)):
            colSplit.append(colNo)
            newColWidth.append(pageColWidth)
            pageColWidth = [colW]
            total = colW
        else:
            pageColWidth.append(colW)
            total += colW
        colNo += 1
    colSplit.append(len(colWidths))
    newColWidth.append(pageColWidth)
    self.newColWidth = newColWidth
    total = 0
    rowNo = 0
    lastKnownHeight = 20
    rowSplit = []
    for rowH in rowHeights:
        if (rowH == None):
            rowH = lastKnownHeight
        else:
            lastKnownHeight = rowH
        if ((total + rowH) > self.body_height):
            rowSplit.append(rowNo)
            total = (2 * rowH)
        else:
            total += rowH
        rowNo += 1
    rowSplit.append(rowNo)
    pages = []
    startRow = 1
    for endRow in rowSplit:
        startCol = 0
        for endCol in colSplit:
            page = []
            pappend = page.append
            label = []
            lappend = label.append
            for colIndex in range(startCol, endCol):
                try:
                    lappend(self.labels[colIndex])
                except IndexError:
                    lappend('')
            pappend(label)
            for rowIndex in range(startRow, endRow):
                line = []
                lappend = line.append
                for colIndex in range(startCol, endCol):
                    try:
                        lappend(self.data[rowIndex][colIndex])
                    except IndexError:
                        if ((len(line) == 0) and (rowIndex in self.subheadingList)):
                            try:
                                lappend(self.data[rowIndex][0])
                            except IndexError:
                                lappend('')
                        else:
                            lappend('')
                pappend(line)
            pages.append(page)
            startCol = endCol
        startRow = endRow
    return pages
