'Add new rows to the table.
See :func:`setData() <pyqtgraph.TableWidget.setData>` for accepted
data types.'

@_defersort
def appendData(self, data):

    startRow = self.rowCount()
    (fn0, header0) = self.iteratorFn(data)
    if (fn0 is None):
        self.clear()
        return
    it0 = fn0(data)
    try:
        first = next(it0)
    except StopIteration:
        return
    (fn1, header1) = self.iteratorFn(first)
    if (fn1 is None):
        self.clear()
        return
    firstVals = [x for x in fn1(first)]
    self.setColumnCount(len(firstVals))
    if ((not self.verticalHeadersSet) and (header0 is not None)):
        labels = [self.verticalHeaderItem(i).text() for i in range(self.rowCount())]
        self.setRowCount((startRow + len(header0)))
        self.setVerticalHeaderLabels((labels + header0))
        self.verticalHeadersSet = True
    if ((not self.horizontalHeadersSet) and (header1 is not None)):
        self.setHorizontalHeaderLabels(header1)
        self.horizontalHeadersSet = True
    i = startRow
    self.setRow(i, firstVals)
    for row in it0:
        i += 1
        self.setRow(i, [x for x in fn1(row)])
    if (self._sorting and (self.horizontalHeader().sortIndicatorSection() >= self.columnCount())):
        self.sortByColumn(0, QtCore.Qt.AscendingOrder)
