protected function wrapCell($contents, $width)
{
// Account for left-indented cells.
if (strpos($contents, ' ') === 0) {
$trimmed = ltrim($contents, ' ');
$indent = strlen($contents) - strlen($trimmed);
return str_repeat(' ', $indent) . wordwrap($trimmed, $width - $indent, PHP_EOL, true);
}
return wordwrap($contents, $width, PHP_EOL, true);
}