/**
* Renders table cell with padding.
*/
private function renderCell(array
$row, int
$column, string
$cellFormat): string
{ $cell =
$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
) {