# Table Formatting
URL: https://docs.valsight.ai/table-formatting/
Description: Set the table style, resize columns, and control which header cells are merged in a table.
Beyond the values it shows, a table has a style, column widths and merged header cells. The first two are set directly, the third follows from the order of the levels.

## What it is

Tables use the **Modern** table style by default. Switching to **Classic** changes the look, and the setting also applies to older tables.

Columns resize automatically to the best width for the current window. Cells in the table header, or down the left side, are merged where possible.

![A table in the modern style](./images/5621448721.png)

## When to use it

* A column is too narrow to read and you want to widen it for good.
* The header repeats a value on every column and you want it merged into one cell.
* An older table looks different from the rest and should match them.

## Configuration

**Style and column widths:**

1. Select the table. In the **Formatting** section of the chart editor, set **Table style** to **Modern** or **Classic**.
2. Drag a column border to resize that column by hand. The width is saved.
3. Double-click a border to reset that column to its initial width, or use **Reset Column Widths** to reset all of them.

![The table style setting](./images/5620826164.png)

![Resizing a table column by dragging its border](./images/5621252109.png)

**Merged cells:**

Which cells merge depends on the order of the levels, so place them in the intended order in the **Configure Axes** dialog. In the example below, **Country** is placed above **City** and **Year** above **Quarter**, which displays the upper levels as merged cells and adds columns with totals.

| Configure Axes                                                     | Table                                                                     |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------- |
| ![Configure axes with Country above City](./images/5094191034.png) | ![The resulting table with merged Country cells](./images/5094191154.png) |
| ![Configure axes with Year above Quarter](./images/5094191049.png) | ![The resulting table with merged Year cells](./images/5094191039.png)    |

## Good to know

* **Levels have to belong to the same dimension to be merged.** The example uses the dimension Location with the levels Country and City, and the dimension Time with Year and Quarter.
* **A hand-set column width sticks.** Automatic sizing stops applying to that column until you double-click its border to reset it.
* **Row formats are set elsewhere.** Subtotals, totals and indentation live in the **Style Columns and Rows** dialog: see [Styling Data Series, Columns and Rows](/styling-data-series-columns-and-rows/).

## Related

* [Styling Data Series, Columns and Rows](/styling-data-series-columns-and-rows/): subtotal and total formats, indentation, colors.
* [Sorting Level Values](/sorting-level-values/): the order the rows and columns appear in.
* [Data Display in Charts and Tables](/data-display-in-charts-and-tables/): which data a table shows, and at which aggregation.
