Write a table cell using the `TCPDF::MultiCell()` method

This function add page break, if needed.

@param array $cells Array of cells.
@return void
436417
protected function _writeMulticellsMc($cells = []) {
		if (empty($cells) || !is_array($cells)) {
			return;
		}

		if (isset($cells[0][1])) {
			$height = $cells[0][1];
			if ($this->tcpdf->checkPageBreak($height, '', false)) {
				$this->tcpdf->AddPage();
			}
		}

		foreach ($cells as $row) {
			list($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml,
				$autopadding, $maxh, $valign, $fitcell) = $row;
			$this->tcpdf->MultiCell(
				$w,
				$h,
				$txt,
				$border,
				$align,
				$fill,
				$ln,
				$x,
				$y,
				$reseth,
				$stretch,
				$ishtml,
				$autopadding,
				$maxh,
				$valign,
				$fitcell
			);
		}
		$this->tcpdf->ln();
	}
218250
private function _writeBreaks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
	{
		// Get row and column breaks
		$aRowBreaks = array();
		$aColumnBreaks = array();
		foreach ($pSheet->getBreaks() as $cell => $breakType) {
			if ($breakType == PHPExcel_Worksheet::BREAK_ROW) {
				$aRowBreaks[] = $cell;
			} else if ($breakType == PHPExcel_Worksheet::BREAK_COLUMN) {
				$aColumnBreaks[] = $cell;
			}
		}

		// rowBreaks
		if (!empty($aRowBreaks)) {
			$objWriter->startElement('rowBreaks');
			$objWriter->writeAttribute('count',			count($aRowBreaks));
			$objWriter->writeAttribute('manualBreakCount',	count($aRowBreaks));

				foreach ($aRowBreaks as $cell) {
					$coords = PHPExcel_Cell::coordinateFromString($cell);

					$objWriter->startElement('brk');
					$objWriter->writeAttribute('id',	$coords[1]);
					$objWriter->writeAttribute('man',	'1');
					$objWriter->endElement();
				}

			$objWriter->endElement();
		}

		// Second, write column breaks
		if (!empty($aColumnBreaks)) {
			$objWriter->startElement('colBreaks');
			$objWriter->writeAttribute('count',			count($aColumnBreaks));
			$objWriter->writeAttribute('manualBreakCount',	count($aColumnBreaks));

				foreach ($aColumnBreaks as $cell) {
					$coords = PHPExcel_Cell::coordinateFromString($cell);

					$objWriter->startElement('brk');
					$objWriter->writeAttribute('id',	PHPExcel_Cell::columnIndexFromString($coords[0]) - 1);
					$objWriter->writeAttribute('man',	'1');
					$objWriter->endElement();
				}

			$objWriter->endElement();
		}
	}
209646
public function addCells(&$items)
    {
        foreach ($items as $ikey => $item) {
            if ($this->addCell($item, true)) {
                unset($items[$ikey]);
            } else {
                break;
            }
        }
    }
209882
public function assertGridCells($column, $cells)
    {
        $this->gridContext->assertColumnCells(
            $column,
            array_map('trim', !empty($cells) ? explode(';', $cells) : [])
        );
    }
905993
public function start_sheet($columns) {
        if ($this->sheetstarted) {
            echo ",";
        } else {
            $this->sheetstarted = true;
        }
        $this->sheetdatadded = false;
        echo "[";
    }
478484
public function setCells($items)
    {
        Yii::beginProfile(__CLASS__ . ':' . __FUNCTION__);
        while (!empty($items)) {
            $this->currentRow->addCells($items);
            if (!empty($items)) {
                $this->_currentRow = null;
            }
        }
        Yii::endProfile(__CLASS__ . ':' . __FUNCTION__);
    }
129153
public function writeHeaders(array $headers)
    {
        $bar = $this->table_connectorHeader;
        $header = $this->table_headerPart;

        foreach ($headers as $name => $length) {
            $bar .= str_pad('', $length + 2, $this->table_barFiller).$this->table_connectorHeader;

            $header .= ' '.str_pad($name, $length, ' ', STR_PAD_RIGHT).' '.$this->table_headerPart;
        }

        $this->output->writeln($bar);
        $this->output->writeln($header);
        $this->output->writeln($bar);
    }
551235
public function write_blank($row, $col, $format = null) {
        $this->worksheet->setCellValueByColumnAndRow($col, $row+1, '');
        $this->apply_format($row, $col, $format);
    }
598503
function &add_cell($name = null) {
        if (!$name) {
            $name = uniqid(microtime(true), true);
        }
        $this->cells[$name] = new KHtml_Table_Cell();
        return $this->cells[$name];
    }
1038603
protected function write($messages): void
    {
        if (! \is_array($messages)) {
            $messages = [$messages];
        }

        foreach ($messages as $i => $message) {
            $messages[$i] = '    - ' . $message;
        }

        $this->io->writeError($messages, true, IOInterface::VERBOSE);
    }
472917
public function appendCell($cell, $name = null)
    {
        $cell = $this->buildCell($cell);
        if ($name == null && $cell->getName() != '') {
            $name = $cell->getName();
        }

        if ($name == null) {
            $this->cells[] = $cell;
        } else {
            $this->cells[$name] = $cell;
        }
        end($this->cells);
        $cell->setName(key($this->cells));

        return $this;
    }
293342
private function cellStartHandler(array $attrs): void
    {
        // string The text alignment of the text in this box.
        $align = '';
        if (!empty($attrs['align'])) {
            $align = $attrs['align'];
            // RTL supported left/right alignment
            if ($align === 'rightrtl') {
                if ($this->wt_report->rtl) {
                    $align = 'left';
                } else {
                    $align = 'right';
                }
            } elseif ($align === 'leftrtl') {
                if ($this->wt_report->rtl) {
                    $align = 'right';
                } else {
                    $align = 'left';
                }
            }
        }

        // string The color to fill the background of this cell
        $bgcolor = '';
        if (!empty($attrs['bgcolor'])) {
            $bgcolor = $attrs['bgcolor'];
        }

        // int Whether or not the background should be painted
        $fill = 1;
        if (isset($attrs['fill'])) {
            if ($attrs['fill'] === '0') {
                $fill = 0;
            } elseif ($attrs['fill'] === '1') {
                $fill = 1;
            }
        }

        $reseth = true;
        // boolean   if true reset the last cell height (default true)
        if (isset($attrs['reseth'])) {
            if ($attrs['reseth'] === '0') {
                $reseth = false;
            } elseif ($attrs['reseth'] === '1') {
                $reseth = true;
            }
        }

        // mixed Whether or not a border should be printed around this box
        $border = 0;
        if (!empty($attrs['border'])) {
            $border = $attrs['border'];
        }
        // string Border color in HTML code
        $bocolor = '';
        if (!empty($attrs['bocolor'])) {
            $bocolor = $attrs['bocolor'];
        }

        // int Cell height (expressed in points) The starting height of this cell. If the text wraps the height will automatically be adjusted.
        $height = 0;
        if (!empty($attrs['height'])) {
            $height = $attrs['height'];
        }
        // int Cell width (expressed in points) Setting the width to 0 will make it the width from the current location to the right margin.
        $width = 0;
        if (!empty($attrs['width'])) {
            $width = $attrs['width'];
        }

        // int Stretch carachter mode
        $stretch = 0;
        if (!empty($attrs['stretch'])) {
            $stretch = (int) $attrs['stretch'];
        }

        // mixed Position the left corner of this box on the page. The default is the current position.
        $left = ReportBaseElement::CURRENT_POSITION;
        if (isset($attrs['left'])) {
            if ($attrs['left'] === '.') {
                $left = ReportBaseElement::CURRENT_POSITION;
            } elseif (!empty($attrs['left'])) {
                $left = (int) $attrs['left'];
            } elseif ($attrs['left'] === '0') {
                $left = 0;
            }
        }
        // mixed Position the top corner of this box on the page. the default is the current position
        $top = ReportBaseElement::CURRENT_POSITION;
        if (isset($attrs['top'])) {
            if ($attrs['top'] === '.') {
                $top = ReportBaseElement::CURRENT_POSITION;
            } elseif (!empty($attrs['top'])) {
                $top = (int) $attrs['top'];
            } elseif ($attrs['top'] === '0') {
                $top = 0;
            }
        }

        // string The name of the Style that should be used to render the text.
        $style = '';
        if (!empty($attrs['style'])) {
            $style = $attrs['style'];
        }

        // string Text color in html code
        $tcolor = '';
        if (!empty($attrs['tcolor'])) {
            $tcolor = $attrs['tcolor'];
        }

        // int Indicates where the current position should go after the call.
        $ln = 0;
        if (isset($attrs['newline'])) {
            if (!empty($attrs['newline'])) {
                $ln = (int) $attrs['newline'];
            } elseif ($attrs['newline'] === '0') {
                $ln = 0;
            }
        }

        if ($align === 'left') {
            $align = 'L';
        } elseif ($align === 'right') {
            $align = 'R';
        } elseif ($align === 'center') {
            $align = 'C';
        } elseif ($align === 'justify') {
            $align = 'J';
        }

        $this->print_data_stack[] = $this->print_data;
        $this->print_data         = true;

        $this->current_element = $this->report_root->createCell(
            $width,
            $height,
            $border,
            $align,
            $bgcolor,
            $style,
            $ln,
            $top,
            $left,
            $fill,
            $stretch,
            $bocolor,
            $tcolor,
            $reseth
        );
    }
1115330
protected function renderRowCells(PHPRtfLite_Table_Row $row)
    {
        $rowIndex = $row->getRowIndex();

        foreach ($this->getColumns() as $columnIndex => $column) {
            $cell = $this->getCell($rowIndex, $columnIndex + 1);
            if (!$cell->isHorizontalMerged()) {
                $cell->render();
            }
        }
    }
1234529
private function _writeMergeCells(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
	{
		if (count($pSheet->getMergeCells()) > 0) {
			// mergeCells
			$objWriter->startElement('mergeCells');

				// Loop mergeCells
				foreach ($pSheet->getMergeCells() as $mergeCell) {
					// mergeCell
					$objWriter->startElement('mergeCell');
					$objWriter->writeAttribute('ref', $mergeCell);
					$objWriter->endElement();
				}

			$objWriter->endElement();
		}
	}
416429
public function rows(array $data): void
    {
        $this->rows = $data;
        $pdoStatement = $this->provideStatement();
        $this->execute($pdoStatement);
    }
18651
public function removeCell(Cell $cell)
    {
        if ($this->cells->contains($cell)) {
            $this->cells->removeElement($cell);
        }
    }
400655
private function renderCell(array $row, $column, $cellFormat)
    {
        $cell = isset($row[$column]) ? $row[$column] : '';
        $width = $this->effectiveColumnWidths[$column];
        if ($cell instanceof TableCell && $cell->getColspan() > 1) {
            // add the width of the following columns(numbers of colspan).
            foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) {
                $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn];
            }
        }

        // str_pad won't work properly with multi-byte strings, we need to fix the padding
        if (false !== $encoding = mb_detect_encoding($cell, null, true)) {
            $width += strlen($cell) - mb_strwidth($cell, $encoding);
        }

        $style = $this->getColumnStyle($column);

        if ($cell instanceof TableSeparator) {
            return sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width));
        }

        $width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
        $content = sprintf($style->getCellRowContentFormat(), $cell);

        return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType()));
    }