src/Console/Component/Table/CellAttribute.php
public function handleTextOverflow($cell, $maxWidth)
    {
        $lines = explode("\n", $cell);
        if ($this->textOverflow == self::WRAP) {
            $maxLineWidth = max(array_map('mb_strlen', $lines));
            if ($maxLineWidth > $maxWidth) {
                $cell = wordwrap($cell, $maxWidth, "\n");
                // Re-explode the lines
                $lines = explode("\n", $cell);
            }
        } elseif ($this->textOverflow == self::ELLIPSIS) {
            if (mb_strlen($lines[0]) > $maxWidth) {
                $lines = [mb_substr($lines[0], 0, $maxWidth - 2) . '..'];
            }
        } elseif ($this->textOverflow == self::CLIP) {
            if (mb_strlen($lines[0]) > $maxWidth) {
                $lines = [mb_substr($lines[0], 0, $maxWidth)];
            }
        }

        return $lines;
    }
public function handleTextOverflow($cell, $maxWidth)
    {
        $lines = explode("\n", $cell);
        if ($this->textOverflow == self::WRAP) {
            $maxLineWidth = max(array_map('mb_strlen', $lines));
            if ($maxLineWidth > $maxWidth) {
                $cell = wordwrap($cell, $maxWidth, "\n");
                // Re-explode the lines
                $lines = explode("\n", $cell);
            }
        } elseif ($this->textOverflow == self::ELLIPSIS) {
            if (mb_strlen($lines[0]) > $maxWidth) {
                $lines = [mb_substr($lines[0], 0, $maxWidth - 2) . '..'];
            }
        } elseif ($this->textOverflow == self::CLIP) {
            if (mb_strlen($lines[0]) > $maxWidth) {
                $lines = [mb_substr($lines[0], 0, $maxWidth)];
            }
        }

        return $lines;
    }
public function handleTextOverflow ( $ cell , $ maxWidth ) { $ lines = explode ( "\n" , $ cell ) ; if ( $ this -> textOverflow == self :: WRAP ) { $ maxLineWidth = max ( array_map ( 'mb_strlen' , $ lines ) ) ; if ( $ maxLineWidth > $ maxWidth ) { $ cell = wordwrap ( $ cell , $ maxWidth , "\n" ) ; // Re-explode the lines $ lines = explode ( "\n" , $ cell ) ; } } elseif ( $ this -> textOverflow == self :: ELLIPSIS ) { if ( mb_strlen ( $ lines [ 0 ] ) > $ maxWidth ) { $ lines = [ mb_substr ( $ lines [ 0 ] , 0 , $ maxWidth - 2 ) . '..' ] ; } } elseif ( $ this -> textOverflow == self :: CLIP ) { if ( mb_strlen ( $ lines [ 0 ] ) > $ maxWidth ) { $ lines = [ mb_substr ( $ lines [ 0 ] , 0 , $ maxWidth ) ] ; } } return $ lines ; }
When inserting rows, we pre-explode the lines to extra rows from Table
hence this method is separated for pre-processing..
When inserting rows we pre - explode the lines to extra rows from Table hence this method is separated for pre - processing ..