|
| 1 | +--- |
| 2 | +title: "Table Examples" |
| 3 | +linkTitle: "Table Examples" |
| 4 | +weight: 30 |
| 5 | +type: docs |
| 6 | +description: "Live examples of every table variant supported by the theme — basic Markdown tables, alignment, and responsive wide tables." |
| 7 | +--- |
| 8 | + |
| 9 | +This page demonstrates how tables render in the GoodData Docs Theme. Every table on a docs page is automatically wrapped in a responsive container by `static/js/tables.js`. A table that does not fit its container is restacked into a two-column label/value layout by the [resTables](https://github.com/codefog/restables) plugin, with horizontal scrolling and a fade hint as the fallback for tables that cannot be restacked. All variants are styled for both the light and dark theme. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Basic table |
| 14 | + |
| 15 | +A standard Markdown pipe table. The header row gets a shaded background, and cells are separated by borders on all sides. |
| 16 | + |
| 17 | +```markdown |
| 18 | +| Name | Type | Required | Description | |
| 19 | +|-------------|---------|----------|------------------------------------| |
| 20 | +| `workspace` | string | Yes | Workspace identifier. | |
| 21 | +| `title` | string | No | Human-readable dashboard title. | |
| 22 | +| `tags` | array | No | Tags used for filtering and search.| |
| 23 | +``` |
| 24 | + |
| 25 | +| Name | Type | Required | Description | |
| 26 | +|-------------|---------|----------|------------------------------------| |
| 27 | +| `workspace` | string | Yes | Workspace identifier. | |
| 28 | +| `title` | string | No | Human-readable dashboard title. | |
| 29 | +| `tags` | array | No | Tags used for filtering and search.| |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Column alignment |
| 34 | + |
| 35 | +Control alignment with the position of `:` in the separator row. |
| 36 | + |
| 37 | +```markdown |
| 38 | +| Left-aligned | Centered | Right-aligned | |
| 39 | +|:-------------|:--------:|--------------:| |
| 40 | +| Metric | Active | 1,234.56 | |
| 41 | +| Insight | Draft | 42.00 | |
| 42 | +``` |
| 43 | + |
| 44 | +| Left-aligned | Centered | Right-aligned | |
| 45 | +|:-------------|:--------:|--------------:| |
| 46 | +| Metric | Active | 1,234.56 | |
| 47 | +| Insight | Draft | 42.00 | |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## Formatting inside cells |
| 52 | + |
| 53 | +Cells support inline Markdown — code, emphasis, links, and even line breaks with `<br>`. |
| 54 | + |
| 55 | +```markdown |
| 56 | +| Element | Example | |
| 57 | +|-----------------|--------------------------------------------------| |
| 58 | +| Inline code | `SELECT * FROM metrics` | |
| 59 | +| Bold / italic | **required**, *optional* | |
| 60 | +| Link | [GoodData website](https://www.gooddata.com) | |
| 61 | +| Multiple lines | First line<br>Second line | |
| 62 | +``` |
| 63 | + |
| 64 | +| Element | Example | |
| 65 | +|-----------------|--------------------------------------------------| |
| 66 | +| Inline code | `SELECT * FROM metrics` | |
| 67 | +| Bold / italic | **required**, *optional* | |
| 68 | +| Link | [GoodData website](https://www.gooddata.com) | |
| 69 | +| Multiple lines | First line<br>Second line | |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## Responsive behavior |
| 74 | + |
| 75 | +The theme makes every table responsive automatically — no shortcode or extra markup is needed. Instead of a fixed breakpoint, the theme checks whether each table actually fits its container (re-checked on every window resize): |
| 76 | + |
| 77 | +- **Table fits:** it renders as a normal table, regardless of screen size. |
| 78 | +- **Table is wider than its container:** the [resTables](https://github.com/codefog/restables) plugin swaps in a stacked two-column clone of the table, where each original row becomes a group of label/value pairs — no horizontal scrolling needed. Narrow the browser window until a table on this page stops fitting to see it restack. |
| 79 | + |
| 80 | +Tables with merged cells (`rowspan`/`colspan`) or without a header row cannot be mapped to label/value pairs, so they keep their original layout. When such a table overflows, it falls back to scrolling horizontally with a fade overlay on the right edge as a visual hint that more content is available. |
| 81 | + |
| 82 | +The wide table below is the easiest place to see the swap — as the window narrows, it is the first to stop fitting and restack: |
| 83 | + |
| 84 | +| Endpoint | Method | Authentication | Rate limit | Request body | Response | Since version | Notes | |
| 85 | +| -------- | ------ | -------------- | ---------- | ------------ | -------- | ------------- | ----- | |
| 86 | +| `/api/v1/entities/workspaces` | GET | Bearer token | 100 req/min | — | JSON:API collection of workspaces | 1.0 | Supports `include`, `filter`, and pagination query parameters. | |
| 87 | +| `/api/v1/entities/workspaces/{id}` | PUT | Bearer token | 60 req/min | JSON:API workspace document | Updated workspace entity | 1.0 | Requires the `MANAGE` permission on the workspace. | |
| 88 | +| `/api/v1/actions/workspaces/{id}/execution` | POST | Bearer token | 30 req/min | Execution definition (AFM) | Execution result handle | 1.2 | Long-running executions return `202 Accepted` with a polling URL. | |
| 89 | +| `/api/v1/layout/workspaces/{id}/logicalModel` | GET | Bearer token | 100 req/min | — | Declarative logical data model | 1.1 | Use `?includeParents=true` to include inherited datasets. | |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## See also |
| 94 | + |
| 95 | +- [Markdown Reference](markdown-reference) — all Markdown formatting options, including table syntax basics. |
| 96 | +- [Shortcodes reference](shortcodes) — GoodData-specific components that extend Markdown. |
0 commit comments