protected function wrapCell($contents, $width)
    {
        // Account for left-indented cells.
        if (strpos($contents, ' ') === 0) {
            $trimmed = ltrim($contents, ' ');
            $indent = Helper::strlen($contents) - Helper::strlen($trimmed);

            return str_repeat(' ', $indent) . $this->wrapWithDecoration($trimmed, $width - $indent);
        }

        return $this->wrapWithDecoration($contents, $width);
    }
protected function wrapCell($contents, $width)
    {
        // Account for left-indented cells.
        if (strpos($contents, ' ') === 0) {
            $trimmed = ltrim($contents, ' ');
            $indent = Helper::strlen($contents) - Helper::strlen($trimmed);

            return str_repeat(' ', $indent) . $this->wrapWithDecoration($trimmed, $width - $indent);
        }

        return $this->wrapWithDecoration($contents, $width);
    }
protected function wrapCell ( $ contents , $ width ) { // Account for left-indented cells. if ( strpos ( $ contents , ' ' ) === 0 ) { $ trimmed = ltrim ( $ contents , ' ' ) ; $ indent = Helper :: strlen ( $ contents ) - Helper :: strlen ( $ trimmed ) ; return str_repeat ( ' ' , $ indent ) . $ this -> wrapWithDecoration ( $ trimmed , $ width - $ indent ) ; } return $ this -> wrapWithDecoration ( $ contents , $ width ) ; }
Word-wrap the contents of a cell, so that they fit inside a max width.

@param string $contents
@param int    $width

@return string
Word - wrap the contents of a cell so that they fit inside a max width .