# Transposing Grid Data

Canonical page: https://www.adaptabletools.com/docs/handbook-transposing

- Transposition lets users see grid data with rows and columns switched, in a similar way to Excel’s Transpose
- AdapTable opens a separate transposed view (but does not swap main grid’s row/column model in place)
- Configuration options include:
    - which column labels the transposed axes
    - which columns and rows take part
    - where transposed view is rendered

Transposition is similar to Excel in outcome: metrics that were columns can now be read down the grid

However it is delivered as a **dedicated transposed view** not on underlying grid.

The primary reason is that transposition is not possible in AG Grid due to its architectural constraints

Transposition is particularly userful when comparing many column values for a relatively small set of rows.

It allows you to scan a wide table in a “one row per metric” layout.

- Transposing all columns or many rows produces a very wide or tall transposed view
- Use the `columnsToTranspose` and `rowsToTranspose` properties to limit scope when needed

It is a simple 2-step process to create a Transposed View:
1. Open the transposed view from code with `showTransposedView` on the [Grid API](https://www.adaptabletools.com/docs/handbook-managing-grid-data/index.md) section of [Adaptable API](https://www.adaptabletools.com/docs/technical-reference-adaptable-api/index.md)
2. Pass a `TransposeConfig` object

The main options fit together as follows:

| Option                    | Role                                                                                                                                                                                                     |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `transposedColumnId`      | Column whose values become the **headers** of the transposed grid (defaults to [Primary Key](https://www.adaptabletools.com/docs/getting-started-primary-key/index.md) if omitted)                                         |
| `columnsToTranspose`      | Which **source columns** appear as **rows** in the transposed view (default: all columns)                                                                                                                |
| `rowsToTranspose`         | Which **source rows** supply the **columns** of the transposed view—`All`, `VisibleOnly`, or an [AdapTableQL Boolean Expression](https://www.adaptabletools.com/docs/adaptable-ql-expression/index.md) (default: all rows) |
| `transposedViewContainer` | Where the transposed grid is **mounted** (default: **popup**; set this to use a **custom** region — see [Rendering Transposed View](#rendering-transposed-view))                                         |

`transposedViewContainer` is configured in [`Container Options`](https://www.adaptabletools.com/docs/reference/containeroptions.md) (and not `TransposeConfig` like other properties)

### `showTransposedView`

Displays a Transposed View of the grid

Function that transposes the Grid.

The function receives a `TransposeConfig` object and returns void:

```ts
showTransposedView(transposeConfig: TransposeConfig): void;
```

The [`TransposeConfig`](https://www.adaptabletools.com/docs/reference/transposeconfig.md) object is defined as follows:

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [columnsToTranspose](https://www.adaptabletools.com/docs/reference/transposeconfig.md#columnstotranspose) | `string[] \| ((context: `[`AdaptableColumnsContext`](https://www.adaptabletools.com/docs/reference/adaptablecolumnscontext.md)`) => string[])` | Ids of Columns to Transpose | all Grid Columns |
| [hideTransposedColumn](https://www.adaptabletools.com/docs/reference/transposeconfig.md#hidetransposedcolumn) | `boolean` | Hide the Transposed Column | true |
| [rowsToTranspose](https://www.adaptabletools.com/docs/reference/transposeconfig.md#rowstotranspose) | `TypeHint<string, 'VisibleOnly' \| 'All'>` | Which rows are transposed. `'All'` (the default, also used when omitted) takes every row. `'VisibleOnly'` takes the rows currently visible. Any other string is a boolean AdapTableQL expression, and only matching rows are transposed. | All |
| [transposedColumnId](https://www.adaptabletools.com/docs/reference/transposeconfig.md#transposedcolumnid) | `string` | Column to use to do Transposition | Primary Key Column |

**Example: Transposing the Grid**

Show a Grid in Transposed View

- This demo shows how to transpose the Grid
- Clicking the `Transpose Grid` Button will open a new view that transposes the current grid

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {
  AdaptableButton,
  AdaptableOptions,
  DashboardButtonContext,
  TransposeConfig,
} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Transposing Data',
  dashboardOptions: {
    customDashboardButtons: [
      {
        label: 'Transpose Grid Data',
        buttonStyle: {
          tone: 'neutral',
          variant: 'outlined',
        },
        onClick: (
          _button: AdaptableButton<DashboardButtonContext>,
          context: DashboardButtonContext
        ) => {
          const transposeConfig: TransposeConfig = {
            transposedColumnId: 'name',
            hideTransposedColumn: true,
          };
          context.adaptableApi.gridApi.showTransposedView(transposeConfig);
        },
      },
    ],
  },
  initialState: {
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'github_watchers',
            'description',
            'open_issues_count',
            'closed_issues_count',
            'open_pr_count',
            'closed_pr_count',
            'has_projects',
            'has_pages',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
  },
};
```

## Selecting Columns

By default **all** Grid Columns are transposed.

However, if this is not the required behaviour, AdapTable allows developers to specify which Columns should be transposed, when calling the `showTransposedView` function.

This is done via the `columnsToTranspose` property in the [`TransposeConfig`](https://www.adaptabletools.com/docs/reference/transposeconfig.md) object sent to the function.

Developers can either provide a list of ColumnIds directly, or a function that returns a list of ColumnIds

**Example: Transposing: Configuring Columns**

Select which Columns are transposed in Transposed View

- In this example we have set an implementation for the `columnsToTranspose` property to limit which Columns are transposed
- We provide a function which returns all numeric columns plus the `Language` column

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {
  AdaptableButton,
  AdaptableColumnsContext,
  AdaptableOptions,
  DashboardButtonContext,
  TransposeConfig,
} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Transposing Configure Columns',
  dashboardOptions: {
    customDashboardButtons: [
      {
        label: 'Transpose Grid Data',
        buttonStyle: {
          tone: 'neutral',
          variant: 'outlined',
        },
        onClick: (
          _button: AdaptableButton<DashboardButtonContext>,
          context: DashboardButtonContext
        ) => {
          const transposeConfig: TransposeConfig = {
            transposedColumnId: 'name',
            hideTransposedColumn: true,
            columnsToTranspose: (context: AdaptableColumnsContext) => {
              return context.columns
                .filter(
                  column =>
                    column.dataType === 'number' ||
                    column.columnId === 'language'
                )
                .map(column => column.columnId);
            },
          };
          context.adaptableApi.gridApi.showTransposedView(transposeConfig);
        },
      },
    ],
  },
  initialState: {
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'created_at',
            'open_issues_count',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
  },
};
```

## Selecting Rows

By default **all** Grid Rows are also transposed.

Again, if this is not the required behaviour, AdapTable allows developers to specify the Rows to transpose.

This is done via the `rowsToTranspose` property in the [`TransposeConfig`](https://www.adaptabletools.com/docs/reference/transposeconfig.md) object sent to the function.

Developers can provide 3 options for this property:

- `All` - transposes all rows in the DataSet (default value if nothing provided)
- `VisibleOnly` - transposes only rows currently in the Grid (including in Groups)
- [AdapTableQL Boolean Expression](https://www.adaptabletools.com/docs/adaptable-ql-expression/index.md) - only rows that evaluate as true in the provided Expression are transposed

**Example: Transposing: Configuring Rows**

Select which Rows are transposed in Transposed View

- In this example we have set an implementation for the `rowsToTranspose` property
- We provide an AdapTableQL Expression: `[github_stars] > 60000 AND [language] != "HTML"`

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {
  AdaptableButton,
  AdaptableColumnsContext,
  AdaptableOptions,
  DashboardButtonContext,
  TransposeConfig,
} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Transposing Configure Rows',
  dashboardOptions: {
    customDashboardButtons: [
      {
        label: 'Transpose Grid Data',
        buttonStyle: {
          tone: 'neutral',
          variant: 'outlined',
        },
        onClick: (
          _button: AdaptableButton<DashboardButtonContext>,
          context: DashboardButtonContext
        ) => {
          const transposeConfig: TransposeConfig = {
            transposedColumnId: 'name',
            hideTransposedColumn: true,
            rowsToTranspose: '[github_stars] > 60000 AND [language] != "HTML"',
          };
          context.adaptableApi.gridApi.showTransposedView(transposeConfig);
        },
      },
    ],
  },
  initialState: {
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'created_at',
            'open_issues_count',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
  },
};
```

## Rendering Transposed View

By default the Transposed Grid will be displayed in a popup above AG Grid.

This, too, can be changed in AdapTable if need be.

The solution is to provide a property for the `transposedViewContainer` property in [`Container Options`](https://www.adaptabletools.com/docs/reference/containeroptions.md).

Read the [Tutorial on providing Container Options](https://www.adaptabletools.com/docs/dev-guide-tutorial-providing-containers/index.md) for full details on how to specify Custom Divs in AdapTable

**Example: Transposing the Grid**

Display Transposed View in custom location

- This demo displays the Transposed View on the right-hand side of the viewport (50%)
- The main grid shrinks to 50% when the transposed view is open
- When the transposed view is closed, the main grid takes 100% of the width
- A header with a close button (✕) allows you to hide the transposed view

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template + shown below]
index.html
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {
  AdaptableButton,
  AdaptableOptions,
  DashboardButtonContext,
  TransposeConfig,
} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Transposing Custom Location',
  containerOptions: {
    transposedViewContainer: 'demoOutputRight',
  },
  dashboardOptions: {
    customDashboardButtons: [
      {
        label: 'Transpose Grid Data',
        buttonStyle: {
          tone: 'neutral',
          variant: 'outlined',
        },
        onClick: (
          _button: AdaptableButton<DashboardButtonContext>,
          context: DashboardButtonContext
        ) => {
          const transposeConfig: TransposeConfig = {
            transposedColumnId: 'name',
            hideTransposedColumn: true,
          };
          context.adaptableApi.gridApi.showTransposedView(transposeConfig);
        },
      },
    ],
  },
  initialState: {
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'github_watchers',
            'description',
            'open_issues_count',
            'closed_issues_count',
            'open_pr_count',
            'closed_pr_count',
            'has_projects',
            'has_pages',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
  },
};
```

**`index.html`**

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Transposing Custom Container - Vanilla</title>
  </head>
  <body>
    <div
      class="transposing-demo-container"
      style="display: flex; flex-direction: row; height: 100vh; width: 100%">
      <div
        id="mainGridContainer"
        style="flex: 1; min-width: 0; display: flex; flex-direction: column">
        <div id="adaptable"></div>
        <div id="grid"></div>
      </div>
      <div id="transposedPanelWrapper" class="transposed-panel-wrapper">
        <div class="transposed-panel-header">
          <span class="transposed-panel-title">Transposed View</span>
          <button
            type="button"
            id="close-transposed-btn"
            class="transposed-panel-close"
            aria-label="Close transposed view">
            ✕
          </button>
        </div>
        <div id="demoOutputRight"></div>
      </div>
    </div>
    <script src="./src/index.ts"></script>
  </body>
</html>
```

**`src/index.ts`**

```ts
import {
  Adaptable,
  AdaptableApi,
  AdaptableOptions,
  AdaptableReadyInfo,
} from '@adaptabletools/adaptable';

import '@adaptabletools/adaptable/index.css';

import './styles.css';

import {adaptableOptions} from './adaptableOptions';
import {gridOptions} from './gridOptions';
import {onAdaptableReady} from './onAdaptableReady';
import {agGridModules} from './agGridModules';
import {WebFramework} from './rowData';

const adaptableOpts: AdaptableOptions<WebFramework> = {
  ...adaptableOptions,
  stateOptions: {
    loadState: () => Promise.resolve({}),
    persistState: () => Promise.resolve(),
    ...adaptableOptions.stateOptions,
  },
};

Adaptable.init(adaptableOpts, {
  gridOptions,
  modules: agGridModules,
}).then((adaptableApi: AdaptableApi) => {
  adaptableApi.eventApi.on(
    'AdaptableReady',
    (readyInfo: AdaptableReadyInfo) => {
      onAdaptableReady(readyInfo);

      const closeBtn = document.getElementById('close-transposed-btn');
      if (closeBtn) {
        closeBtn.onclick = () => {
          adaptableApi.gridApi.closeTransposedView();
        };
      }
    }
  );
});
```

**`src/App.tsx`** (React version)

```ts
import * as React from 'react';
import {useState} from 'react';
import {
  Adaptable,
  AdaptableApi,
  AdaptableOptions,
  AdaptableReadyInfo,
} from '@adaptabletools/adaptable-react-aggrid';

import {GridOptions} from 'ag-grid-enterprise';

import '@adaptabletools/adaptable-react-aggrid/index.css';
import './styles.css';

import {adaptableOptions} from './adaptableOptions';
import {onAdaptableReady} from './onAdaptableReady';
import {gridOptions} from './gridOptions';
import {agGridModules} from './agGridModules';
import {WebFramework} from './rowData';

const App: React.FunctionComponent = () => {
  const adaptableApiRef = React.useRef<AdaptableApi>(null);

  const [adaptOptions, setAdaptOptions] = useState<
    AdaptableOptions<WebFramework>
  >({
    ...adaptableOptions,
    stateOptions: {
      loadState: () => Promise.resolve({}),
      persistState: () => Promise.resolve(),
      ...adaptableOptions.stateOptions,
    },
  });
  const [agGridOptions, setAgGridOptions] = useState<GridOptions>(gridOptions);

  return (
    <div
      className="transposing-demo-container"
      style={{
        display: 'flex',
        flexDirection: 'row',
        height: '100vh',
        width: '100%',
      }}>
      <div id="mainGridContainer" style={{flex: 1, minWidth: 0}}>
        <Adaptable.Provider
          gridOptions={agGridOptions}
          adaptableOptions={adaptOptions}
          modules={[...agGridModules]}
          onAdaptableReady={(adaptableReadyInfo: AdaptableReadyInfo) => {
            adaptableApiRef.current = adaptableReadyInfo.adaptableApi;
            onAdaptableReady(adaptableReadyInfo);
          }}>
          <Adaptable.UI style={{flex: 'none'}} />
          <Adaptable.AgGridReact />
        </Adaptable.Provider>
      </div>
      <div id="transposedPanelWrapper" className="transposed-panel-wrapper">
        <div className="transposed-panel-header">
          <span className="transposed-panel-title">Transposed View</span>
          <button
            type="button"
            className="transposed-panel-close"
            onClick={() =>
              adaptableApiRef.current?.gridApi.closeTransposedView()
            }
            aria-label="Close transposed view">
            ✕
          </button>
        </div>
        <div id="demoOutputRight" />
      </div>
    </div>
  );
};

export default App;
```

**`src/app/app.component.ts`** (Angular version)

```ts
import {Component} from '@angular/core';

import {
  AdaptableOptions,
  AdaptableReadyInfo,
  AdaptableApi,
} from '@adaptabletools/adaptable-angular-aggrid';
import {GridOptions} from 'ag-grid-enterprise';

import '@adaptabletools/adaptable-angular-aggrid/index.css';

import './styles.css';

import {adaptableOptions} from './adaptableOptions';
import {gridOptions} from './gridOptions';
import {agGridModules} from './agGridModules';
import {onAdaptableReady} from './onAdaptableReady';
import {WebFramework} from './rowData';

@Component({
  standalone: false,
  selector: 'app-root',
  template: `
    <div
      class="transposing-demo-container"
      style="display: flex; flex-direction: row; align-items: stretch; height: 100vh; width: 100%; overflow: hidden">
      <div
        id="mainGridContainer"
        style="flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden">
        <adaptable-provider
          [adaptableOptions]="adaptableOpts"
          [gridOptions]="agGridOptions"
          [modules]="modules"
          (adaptableReady)="adaptableReady($event)"
          style="flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden">
          <adaptable-ui style="flex: none"></adaptable-ui>
          <ag-grid-angular
            *adaptable="let adaptable"
            [gridOptions]="adaptable.gridOptions"
            [modules]="adaptable.modules"
            style="flex: 1; min-height: 0">
          </ag-grid-angular>
        </adaptable-provider>
      </div>
      <div id="transposedPanelWrapper" class="transposed-panel-wrapper">
        <div class="transposed-panel-header">
          <span class="transposed-panel-title">Transposed View</span>
          <button
            type="button"
            class="transposed-panel-close"
            (click)="closeTransposedView()"
            aria-label="Close transposed view">
            ✕
          </button>
        </div>
        <div id="demoOutputRight"></div>
      </div>
    </div>
  `,
  styles: [
    `
      :host {
        height: 100vh;
        min-height: 0;
        display: block;
      }
    `,
  ],
})
export class AppComponent {
  adaptableOpts: AdaptableOptions<WebFramework> = {
    ...adaptableOptions,
    stateOptions: {
      loadState: () => Promise.resolve({}),
      persistState: () => Promise.resolve(),
      ...adaptableOptions.stateOptions,
    },
  };
  agGridOptions: GridOptions<WebFramework> = gridOptions;
  modules = agGridModules;

  private adaptableApi: AdaptableApi | null = null;

  adaptableReady($event: AdaptableReadyInfo) {
    this.adaptableApi = $event.adaptableApi;
    onAdaptableReady($event);
  }

  closeTransposedView() {
    this.adaptableApi?.gridApi.closeTransposedView();
  }
}
```

**`src/App.vue`** (Vue version)

```ts
<template>
  <div
    class="transposing-demo-container"
    style="display: flex; flex-direction: row; height: 100vh; width: 100%">
    <div id="mainGridContainer" style="flex: 1; min-width: 0">
      <AdaptableProvider
        :gridOptions="gridOptions"
        :adaptableOptions="adaptableOpts"
        :modules="agGridModules"
        @onAdaptableReady="onAdaptableReadyHandler">
        <AdaptableUI style="flex: none" />
        <AdaptableAgGridVue style="flex: 1" />
      </AdaptableProvider>
    </div>
    <div id="transposedPanelWrapper" class="transposed-panel-wrapper">
      <div class="transposed-panel-header">
        <span class="transposed-panel-title">Transposed View</span>
        <button
          type="button"
          class="transposed-panel-close"
          @click="closeTransposedView"
          aria-label="Close transposed view">
          ✕
        </button>
      </div>
      <div id="demoOutputRight" />
    </div>
  </div>
</template>

<script setup lang="ts">
import {ref} from 'vue';
import {
  AdaptableProvider,
  AdaptableAgGridVue,
  AdaptableUI,
  AdaptableOptions,
  AdaptableReadyInfo,
} from '@adaptabletools/adaptable-vue3-aggrid';
import {adaptableOptions} from './adaptableOptions';
import {onAdaptableReady} from './onAdaptableReady';
import {gridOptions} from './gridOptions';
import {agGridModules} from './agGridModules';
import {WebFramework} from './rowData';

const adaptableApiRef = ref<{
  userInterfaceApi: {closeCustomWindowPopup: (id: string) => void};
} | null>(null);

const adaptableOpts: AdaptableOptions<WebFramework> = {
  ...adaptableOptions,
  stateOptions: {
    loadState: () => Promise.resolve({}),
    persistState: () => Promise.resolve(),
    ...adaptableOptions.stateOptions,
  },
};

const onAdaptableReadyHandler = (info: AdaptableReadyInfo) => {
  adaptableApiRef.value = info.adaptableApi;
  onAdaptableReady(info);
};

const closeTransposedView = () => {
  adaptableApiRef.value?.gridApi.closeTransposedView();
};
</script>
```

**`src/styles.css`**

```css
/* Transposed view on the right: 50% when open, main grid shrinks accordingly */
.transposing-demo-container {
  min-height: 0;
}

.transposing-demo-container #mainGridContainer {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Transposed panel wrapper - hidden when empty */
.transposed-panel-wrapper:has(#demoOutputRight:empty) {
  display: none;
}

/* When transposed view has content: 50/50 split with header */
.transposed-panel-wrapper:not(:has(#demoOutputRight:empty)) {
  display: flex;
  flex-direction: column;
  flex: 0 0 50%;
  width: 50%;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--ag-border-color, #404c5a);
}

.transposed-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #2b2d31;
  color: #e2e2e2;
  border-bottom: 1px solid var(--ag-border-color, #404c5a);
  flex-shrink: 0;
}

/* When Adaptable dark theme is active, use theme variables */
.transposed-panel-header {
  background: var(--ab-color-primary);
  color: var(--ab-color-primary-foreground);
}

.transposed-panel-title {
  font-weight: 600;
  font-size: 14px;
}

.transposed-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  border-radius: 4px;
}

.transposed-panel-close:hover {
  background: var(--ag-row-hover-color, rgba(255, 255, 255, 0.08));
}

#demoOutputRight {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
```

### FAQ

**Can we save the transposed view?**
No. Opening or closing the transposed view and the `TransposeConfig` passed to `showTransposedView` are **not** part of persisted Adaptable State (for example [Layout](https://www.adaptabletools.com/docs/technical-reference-layouts/index.md)).

- You can still persist your own UI preference in application state however
- And you can then call `showTransposedView` again with the same config when the user returns
