public function render(array $rows, array $header = [], $defaultColumns = [])
    {
        $format = $this->getFormat();

        $columnsToDisplay = $this->columnsToDisplay() ?: $defaultColumns;
        $rows = $this->filterColumns($rows, $header, $columnsToDisplay);
        $header = $this->filterColumns([0 => $header], $header, $columnsToDisplay)[0];

        if ($this->input->hasOption('no-header') && $this->input->getOption('no-header')) {
            $header = [];
        }

        switch ($format) {
            case 'csv':
                $this->renderCsv($rows, $header);
                break;

            case 'tsv':
                $this->renderCsv($rows, $header, "\t");
                break;

            case null:
            case 'table':
                $this->renderTable($rows, $header);
                break;

            default:
                throw new InvalidArgumentException(sprintf('Invalid format: %s', $format));
        }
    }