public function getEstimatedNbColumns($maxTotalWidth)
    {
        $i = 0;
        $rowWidth = 0;

        while (isset($this->cells[$i])) {
            $rowWidth += StringUtil::getLength($this->cells[$i]);

            if ($rowWidth > $maxTotalWidth) {
                // Return previous number of columns
                return $i;
            }

            ++$i;
        }

        return $i;
    }