code: private function writeRows(XMLWriter $objWriter, Worksheet $sheet)
      {
          $numberRowsRepeated = self::NUMBER_ROWS_REPEATED_MAX;
          $span_row = 0;
          $rows = $sheet->getRowIterator();
          while ($rows->valid()) {
              --$numberRowsRepeated;
              $row = $rows->current();
              if ($row->getCellIterator()->valid()) {
                  if ($span_row) {
                      $objWriter->startElement('table:table-row');
                      if ($span_row > 1) {
                          $objWriter->writeAttribute('table:number-rows-repeated', $span_row);
                      }
                      $objWriter->startElement('table:table-cell');
                      $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
                      $objWriter->endElement();
                      $objWriter->endElement();
                      $span_row = 0;
                  }
                  $objWriter->startElement('table:table-row');
                  $this->writeCells($objWriter, $row);
                  $objWriter->endElement();
              } else {
                  ++$span_row;
              }
              $rows->next();
          }
      }
docs: Write rows of the specified sheet.
  
  @param XMLWriter $objWriter
  @param Worksheet $sheet