Skip to content

Commit c4d9c51

Browse files
authored
docs(table): document per-column width controls (fixed px / flexible weight, bulk, fit-to-content) (cube-js#11180)
Documents the per-column width model for table charts: Fixed (px) / Flexible (weight) modes, drag-to-resize, per-column and bulk fit-to-content, and All flexible / All fixed / All fit to content bulk controls with their enablement rules.
1 parent f9398ab commit c4d9c51

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

  • docs-mintlify/docs/explore-analyze/charts/chart-types

docs-mintlify/docs/explore-analyze/charts/chart-types/table.mdx

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,60 @@ The **Table** tab in the configuration panel controls layout and display setting
3232

3333
| Option | Description |
3434
|---|---|
35-
| **Column width** | **Stretch** fills the full table width; **Fixed** keeps column widths constant regardless of tile size |
3635
| **Header text** | Controls whether long column headers **truncate** or **wrap** to the next line |
3736
| **View names** | When enabled, the view/cube name is shown in the column header |
3837
| **Row numbers** | Adds a row number column on the left |
3938
| **Group dimensions** | Groups multiple dimensions per row into a collapsible section for subtotaling |
4039

40+
Column widths are configured **per column** — see [Column width](#column-width) below.
41+
4142
## Column field options
4243

43-
Click the dropdown arrow on any field in the **Fields** section to configure it:
44+
Configure individual columns in the **Columns** section of the **Style** tab (or via the dropdown arrow on a field in the **Fields** section):
4445

4546
| Option | Description |
4647
|---|---|
4748
| **Label** | Override the column header text |
4849
| **Alignment** | Left, center, or right |
4950
| **Word wrap** | Allow cell content to wrap to multiple lines |
51+
| **Width** | **Flexible** (a weight) or **Fixed** (pixels) — see [Column width](#column-width) |
5052
| **Hide** | Show or hide the column |
5153

54+
## Column width
55+
56+
Each column's width is set independently in the **Columns** section of the **Style** tab. A column is in one of two modes:
57+
58+
- **Flexible** (the default) — the column shares the table's available width with the other flexible columns, in proportion to its **weight**. A column with weight `2` is twice as wide as a column with weight `1`. New columns start at weight `1`, so by default all columns share the width equally and the table stretches to fill its tile.
59+
- **Fixed** — the column is locked to an exact pixel width and no longer participates in the weight-based distribution. Fixed columns keep their width regardless of the tile size; if the fixed columns don't fill the tile, the remaining space is left blank.
60+
61+
You can mix the two: give a label column a fixed width and let the metric columns flex to share the rest.
62+
63+
### Setting widths
64+
65+
- **In the panel** — pick **Flexible** or **Fixed** for a column and enter its weight or pixel value.
66+
- **By dragging** — drag the border between two column headers on the table. The change is saved into the column's current mode (a flexible column keeps flexing at its new relative size; a fixed column updates its pixel width).
67+
- **Fit to content** — the **Fit to content** button next to a column's width sizes it to its content and switches it to **Fixed** at that width.
68+
69+
<Note>
70+
71+
Fit to content measures the rows currently rendered on screen. If a wider value is further down a long, scrolled table, fit to content again after scrolling to it.
72+
73+
</Note>
74+
75+
### Bulk controls
76+
77+
At the top of the **Columns** section:
78+
79+
- **All flexible** — converts every column to flexible, deriving each weight from its current width (so the layout doesn't jump). Enabled only when at least one column is fixed.
80+
- **All fixed** — freezes every column at its current rendered pixel width. Enabled only when at least one column is flexible.
81+
- **All fit to content** — sizes every column to its content and fixes it at that width, in a single action (the bulk equivalent of the per-column **Fit to content**). Like per-column fit to content, it measures the rows currently rendered on screen.
82+
83+
<Note>
84+
85+
Under a column pivot, a width set on a measure applies to every column generated for that measure.
86+
87+
</Note>
88+
5289
## Display tab — showing columns as links, images, bars, or sparklines
5390

5491
By default, columns display their raw value. The **Display** tab for each field lets you change this:

0 commit comments

Comments
 (0)