public function format(array $rows, callable $callback) : string
    {
        foreach ($rows as &$row) {
            $row = (array)$row;
        }

        $maxLengths = $this->normalizeColumns($rows);
        $paddingType = $this->padAfter ? STR_PAD_RIGHT : STR_PAD_LEFT;

        // Format the rows
        foreach ($rows as &$row) {
            foreach ($row as $index => &$item) {
                $item = str_pad($item, $maxLengths[$index], $this->paddingString, $paddingType);
            }
        }

        $formattedText = '';

        foreach ($rows as &$row) {
            $formattedText .= $callback($row) . $this->eolChar;
        }

        // Trim the excess separator
        $formattedText = preg_replace('/' . preg_quote($this->eolChar, '/') . '$/', '', $formattedText);

        return $formattedText;
    }