// 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->
getBorderChars()[2
],
$width));
} $width += Helper::
length($cell) - Helper::
length(Helper::
removeDecoration($this->output->
getFormatter(),
$cell));
$content =
sprintf($style->
getCellRowContentFormat(),
$cell);
$padType =
$style->
getPadType();
if ($cell instanceof TableCell &&
$cell->
getStyle() instanceof TableCellStyle
) { $isNotStyledByTag = !
preg_match('/^<(\w+|(\w+=[\w,]+;?)*)>.+<\/(\w+|(\w+=\w+;?)*)?>$/',
$cell);
if ($isNotStyledByTag) { $cellFormat =
$cell->
getStyle()->
getCellFormat();
if (!\
is_string($cellFormat)) { $tag =
http_build_query($cell->
getStyle()->
getTagOptions(), '', ';'
);
$cellFormat = '<'.
$tag.'>%s</>';
}