> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentation for the Pretty format

# Pretty

| Input | Output | Alias |
| ----- | ------ | ----- |
| ✗     | ✔      |       |

<h2 id="description">
  Description
</h2>

The `Pretty` format outputs data as Unicode-art tables,
using ANSI-escape sequences for displaying colors in the terminal.
A full grid of the table is drawn, and each row occupies two lines in the terminal.
Each result block is output as a separate table.
This is necessary so that blocks can be output without buffering results (buffering would be necessary to pre-calculate the visible width of all the values).

[NULL](/docs/reference/syntax) is output as `ᴺᵁᴸᴸ`.

<h2 id="example-usage">
  Example usage
</h2>

Example (shown for the [`PrettyCompact`](/docs/reference/formats/Pretty/PrettyCompact) format):

```sql title="Query" theme={null}
SELECT * FROM t_null
```

```response title="Response" theme={null}
┌─x─┬────y─┐
│ 1 │ ᴺᵁᴸᴸ │
└───┴──────┘
```

Rows are not escaped in any of the `Pretty` formats. The following example is shown for the [`PrettyCompact`](/docs/reference/formats/Pretty/PrettyCompact) format:

```sql title="Query" theme={null}
SELECT 'String with \'quotes\' and \t character' AS Escaping_test
```

```response title="Response" theme={null}
┌─Escaping_test────────────────────────┐
│ String with 'quotes' and      character │
└──────────────────────────────────────┘
```

To avoid dumping too much data to the terminal, only the first `10,000` rows are printed.
If the number of rows is greater than or equal to `10,000`, the message "Showed first 10 000" is printed.

<Note>
  This format is only appropriate for outputting a query result, but not for parsing data.
</Note>

The Pretty format supports outputting total values (when using `WITH TOTALS`) and extremes (when 'extremes' is set to 1).
In these cases, total values and extreme values are output after the main data, in separate tables.
This is shown in the following example which uses the [`PrettyCompact`](/docs/reference/formats/Pretty/PrettyCompact) format:

```sql title="Query" theme={null}
SELECT EventDate, count() AS c 
FROM test.hits 
GROUP BY EventDate 
WITH TOTALS 
ORDER BY EventDate 
FORMAT PrettyCompact
```

```response title="Response" theme={null}
┌──EventDate─┬───────c─┐
│ 2014-03-17 │ 1406958 │
│ 2014-03-18 │ 1383658 │
│ 2014-03-19 │ 1405797 │
│ 2014-03-20 │ 1353623 │
│ 2014-03-21 │ 1245779 │
│ 2014-03-22 │ 1031592 │
│ 2014-03-23 │ 1046491 │
└────────────┴─────────┘

Totals:
┌──EventDate─┬───────c─┐
│ 1970-01-01 │ 8873898 │
└────────────┴─────────┘

Extremes:
┌──EventDate─┬───────c─┐
│ 2014-03-17 │ 1031592 │
│ 2014-03-23 │ 1406958 │
└────────────┴─────────┘
```

<h2 id="format-settings">
  Format settings
</h2>

The following settings are common to all `Pretty` formats:

| Setting                                                                                                                                                            | Description                                                                                                                                                                                                                          | Default |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| [`output_format_pretty_max_rows`](/docs/reference/settings/formats/output-format#output_format_pretty_max_rows)                                                         | Row limit for Pretty formats.                                                                                                                                                                                                        | `10000` |
| [`output_format_pretty_max_column_pad_width`](/docs/reference/settings/formats/output-format#output_format_pretty_max_column_pad_width)                                 | Maximum width to pad all values in a column in Pretty formats.                                                                                                                                                                       | `250`   |
| [`output_format_pretty_max_value_width`](/docs/reference/settings/formats/output-format#output_format_pretty_max_value_width)                                           | Maximum width of value to display in Pretty formats. If greater - it will be cut.                                                                                                                                                    | `10000` |
| [`output_format_pretty_color`](/docs/reference/settings/formats/output-format#output_format_pretty_color)                                                               | Use ANSI escape sequences to paint colors in Pretty formats.                                                                                                                                                                         | `true`  |
| [`output_format_pretty_grid_charset`](/docs/reference/settings/formats/output-format#output_format_pretty_grid_charset)                                                 | Charset for printing grid borders. Available charsets: ASCII, UTF-8.                                                                                                                                                                 | `UTF-8` |
| [`output_format_pretty_row_numbers`](/docs/reference/settings/formats/output-format#output_format_pretty_row_numbers)                                                   | Add row numbers before each row for pretty output format.                                                                                                                                                                            | `true`  |
| [`output_format_pretty_display_footer_column_names`](/docs/reference/settings/formats/output-format#output_format_pretty_display_footer_column_names)                   | Display column names in the footer if table contains many rows.                                                                                                                                                                      | `true`  |
| [`output_format_pretty_display_footer_column_names_min_rows`](/docs/reference/settings/formats/output-format#output_format_pretty_display_footer_column_names_min_rows) | Sets the minimum number of rows for which a footer will be displayed if [`output_format_pretty_display_footer_column_names`](/docs/reference/settings/formats/output-format#output_format_pretty_display_footer_column_names) is enabled. | `50`    |
