|
| 1 | +--- |
| 2 | +icon: table |
| 3 | +category: display-data |
| 4 | +summary: Turn query results into a sortable, searchable table. |
| 5 | +top: |
| 6 | + - name: align_center |
| 7 | + type: TEXT |
| 8 | + description: Name of a column the contents of which should be center-aligned. This argument can be repeated |
| 9 | + multiple times to align multiple columns to the center. |
| 10 | + - name: align_right |
| 11 | + type: TEXT |
| 12 | + description: Name of a column the contents of which should be right-aligned. This argument can be repeated |
| 13 | + multiple times to align multiple columns to the right. Introduced in v0.15.0. |
| 14 | + - name: border |
| 15 | + type: BOOLEAN |
| 16 | + description: Whether to draw borders on all sides of the table and cells. |
| 17 | + - class |
| 18 | + - name: currency |
| 19 | + type: TEXT |
| 20 | + description: The ISO 4217 currency code (e.g., USD, EUR, GBP, etc.) to use when formatting monetary values. |
| 21 | + - name: custom_actions |
| 22 | + type: JSON |
| 23 | + description: 'If set, a column of custom action buttons will be added to each row. The value of this property |
| 24 | + should be a JSON array of objects, each object defining a button with the following properties: `name` |
| 25 | + (the text to display on the button), `icon` (the tabler icon name or image link to display on the button), |
| 26 | + `link` (the URL to navigate to when the button is clicked, possibly containing the `{id}` placeholder |
| 27 | + that will be replaced by the value of the `_sqlpage_id` property for that row), and `tooltip` (optional |
| 28 | + text to display when hovering over the button). Added in v0.39.0' |
| 29 | + - name: delete_url |
| 30 | + type: TEXT |
| 31 | + description: If set, a delete button will be added to each row. The value of this property should be a |
| 32 | + URL, possibly containing the `{id}` placeholder that will be replaced by the value of the `_sqlpage_id` |
| 33 | + property for that row. Clicking the delete button will take the user to that URL. Added in v0.39.0 |
| 34 | + - name: description |
| 35 | + type: TEXT |
| 36 | + description: Description of the table contents. Helps users with screen readers to find a table and understand |
| 37 | + what it’s about. |
| 38 | + - name: edit_url |
| 39 | + type: TEXT |
| 40 | + description: If set, an edit button will be added to each row. The value of this property should be a URL, |
| 41 | + possibly containing the `{id}` placeholder that will be replaced by the value of the `_sqlpage_id` property |
| 42 | + for that row. Clicking the edit button will take the user to that URL. Added in v0.39.0 |
| 43 | + - name: embed |
| 44 | + type: TEXT |
| 45 | + description: Name of a column whose values are URLs to HTML fragments, such as other SQLPage pages. |
| 46 | + Repeat this property to select multiple columns. The browser fetches each nonempty URL with |
| 47 | + `_sqlpage_embed=1`, which skips the SQLPage shell, and initializes any components inside the cell. |
| 48 | + Use only URLs whose HTML you trust. There is one request per populated cell. Sorting uses the original |
| 49 | + URL, and search skips embedded cells. |
| 50 | + - name: empty_description |
| 51 | + type: TEXT |
| 52 | + description: Text to display if the table does not contain any row. Defaults to "no data". |
| 53 | + - name: freeze_columns |
| 54 | + type: BOOLEAN |
| 55 | + description: Whether to freeze the leftmost column of the table. |
| 56 | + - name: freeze_footers |
| 57 | + type: BOOLEAN |
| 58 | + description: Whether to freeze the footer (bottom row) of the table, only works if that row has the `_sqlpage_footer` |
| 59 | + property applied to it. |
| 60 | + - name: freeze_headers |
| 61 | + type: BOOLEAN |
| 62 | + description: Whether to freeze the top row of the table. |
| 63 | + - name: hover |
| 64 | + type: BOOLEAN |
| 65 | + description: Whether to enable a hover state on table rows. |
| 66 | + - name: icon |
| 67 | + type: TEXT |
| 68 | + description: Set this to the name of a column whose content should be interpreted as a tabler icon name. |
| 69 | + Used to display icons in the table. This argument can be repeated multiple times to intepret multiple |
| 70 | + columns as icons. Introduced in v0.8.0. |
| 71 | + - id |
| 72 | + - name: initial_search_value |
| 73 | + type: TEXT |
| 74 | + description: Pre-fills the search bar used to filter the table. The user will still be able to edit the |
| 75 | + value to display table rows that will initially be filtered out. |
| 76 | + - name: markdown |
| 77 | + type: TEXT |
| 78 | + description: Set this to the name of a column whose content should be interpreted as markdown . Used to |
| 79 | + display rich text with links in the table. This argument can be repeated multiple times to intepret multiple |
| 80 | + columns as markdown. |
| 81 | + - name: money |
| 82 | + type: TEXT |
| 83 | + description: Name of a numeric column whose values should be displayed as currency amounts, in the currency |
| 84 | + defined by the `currency` property. This argument can be repeated multiple times. |
| 85 | + - name: monospace |
| 86 | + type: TEXT |
| 87 | + description: Name of a column the contents of which should be displayed in monospace. This argument can |
| 88 | + be repeated multiple times to display multiple columns in monospace. Introduced in v0.32.1. |
| 89 | + - name: number_format_digits |
| 90 | + type: INTEGER |
| 91 | + description: Maximum number of decimal digits to display for numeric values. |
| 92 | + - name: number_format_locale |
| 93 | + type: TEXT |
| 94 | + description: A BCP 47 language tag (e.g. "de-DE", "en-IN") deciding how numbers and monetary values are |
| 95 | + formatted. Defaults to the locale of the visitor's browser. |
| 96 | + - name: overflow |
| 97 | + type: BOOLEAN |
| 98 | + description: Whether to to let "wide" tables overflow across the right border and enable browser-based |
| 99 | + horizontal scrolling. |
| 100 | + - name: raw_numbers |
| 101 | + type: TEXT |
| 102 | + description: Name of a column whose values are numeric, but should be displayed as raw numbers without |
| 103 | + any formatting (no thousands separators, decimal separator is always a dot). This argument can be repeated |
| 104 | + multiple times. |
| 105 | + - name: search |
| 106 | + type: BOOLEAN |
| 107 | + description: Add a search bar at the top of the table, letting users easily filter table rows by value. |
| 108 | + - name: search_placeholder |
| 109 | + type: TEXT |
| 110 | + description: Customizes the placeholder text shown in the search input field. Replaces the default "Search..." |
| 111 | + with text that better describes what users should search for. |
| 112 | + - name: small |
| 113 | + type: BOOLEAN |
| 114 | + description: Whether to use compact table. |
| 115 | + - name: sort |
| 116 | + type: BOOLEAN |
| 117 | + description: Make the columns clickable to let the user sort by the value contained in the column. |
| 118 | + - name: striped_columns |
| 119 | + type: BOOLEAN |
| 120 | + description: Whether to add zebra-striping to any table column. |
| 121 | + - name: striped_rows |
| 122 | + type: BOOLEAN |
| 123 | + description: Whether to add zebra-striping to any table row. |
| 124 | + - name: title |
| 125 | + type: TEXT |
| 126 | + description: A title displayed above the table. |
| 127 | +row: |
| 128 | + - name: _sqlpage_actions |
| 129 | + type: JSON |
| 130 | + description: 'Sets custom action buttons for this specific row in addition to any defined at the table |
| 131 | + level, The value of this property should be a JSON array of objects, each object defining a button with |
| 132 | + the following properties: `name` (the text to display on the button), `icon` (the tabler icon name or |
| 133 | + image link to display on the button), `link` (the URL to navigate to when the button is clicked, possibly |
| 134 | + containing the `{id}` placeholder that will be replaced by the value of the `_sqlpage_id` property for |
| 135 | + that row), and `tooltip` (optional text to display when hovering over the button). Added in v0.39.0' |
| 136 | + - name: _sqlpage_color |
| 137 | + type: COLOR |
| 138 | + description: Sets the background color of the row. Added in v0.8.0. |
| 139 | + - name: _sqlpage_css_class |
| 140 | + type: TEXT |
| 141 | + description: For advanced users. Sets a css class on the table row. Added in v0.8.0. |
| 142 | + - name: _sqlpage_footer |
| 143 | + type: BOOLEAN |
| 144 | + description: Sets this row as the table footer. It is recommended that this parameter is applied to the |
| 145 | + last row. Added in v0.34.0. |
| 146 | + - name: _sqlpage_id |
| 147 | + type: TEXT |
| 148 | + description: Sets the id of the html tabler row element. Allows you to make links targeting a specific |
| 149 | + row in a table. |
| 150 | +--- |
| 151 | + |
| 152 | +A table with optional filtering and sorting. |
| 153 | +Unlike most others, this component does not have a fixed set of item properties, any property that is used will be rendered directly as a column in the table. |
| 154 | +Tables can contain rich text, including images, links, and icons. Table rows can be styled with a background color, and the table can be made striped, hoverable, and bordered. |
| 155 | + |
| 156 | +Advanced users can apply custom styles to table columns using a CSS class with the same name as the column, and to table rows using the `_sqlpage_css_class` property. |
0 commit comments