Table components have the following properties.
General
- Title
- A title for the table. Select Markdown for custom formatting.
Value: string - Data source
- The array of objects to display in a table.
Values: query, demo data, components
Columns
Each column of data from the data source is represented here and has the following properties:
- Label
- The text that displays at the top of the column.
Value: string or expression - Data path
- JSON path to access values nested within objects and arrays of a given column.
Value: string or expression - Formatting
- The type of format that the column takes on.
Provided values: string, link, status pill, date / time, markdown, tags, percent bar, number, score bar, avatar - Sortable
- Determines whether the user can sort by the column.
- Copyable
- Determines whether the user can click to copy the contents of the column.
Provided values: on, off - Filterable
- Determines whether a filter option is available for the column.
Provided values: on, off
Some columns have additional properties based on their Formatting property.
- Has summary
- Determines whether to display a pagination summary directly above the table.
Provided values: on, off - Page size
- Number of rows per page to display.
Value: number or expression that evaluates to a number - Total count
- Total number of rows to display in the table.
Value: number or expression that evaluates to a number - Type
- Determines the type of pagination.
Provided values: client side, server side
Sorting
- Select the column and direction for default table sorting.
- Column
- The column to sort by.
Value: column name - Direction
- The direction to sort.
Provided values: ascending, descending
Row actions
Adding a row action adds an Actions column to the table, which contains user-defined action buttons. Rows can have multiple actions. Actions have the following properties:
- Label
- The text that displays on the action button.
Value: string or expression - Primary
- Designed to call user attention to the most important action(s) for a given page or workflow.
Provided values: on, off - Borderless
- Removes the border from any button. On hover, it gets a background fill.
Provided values: on, off - Disabled
- Applies disabled styling and removes interactions.
Provided values: on, off - Level
- Controls the color of the button according to its intent.
Provided values: default, danger, success, warning - Reactions
- The reactions the button triggers. A button can have multiple reactions.
Provided values: download file, open modal, close modal, open side panel, close side panel, open URL, set component state, set state variable value, toast notification, trigger action, custom
Some reaction types have additional properties. - State Function
- fetch
Example: See events.
Appearance
- Scrollable
- Determines what ways the table is scrollable in.
Provided values: both, vertical - Is Loading
- Shows a loading indicator.
Provided values: on, off - Has text wrapping
- Determines whether cell text wraps.
Provided values: on, off - Has subrows
- Enables subrows for each row. Include the
subRows
property in the data source.
Provided values: on, off - Is searchable
- Determines whether to add a search bar to the table.
Provided values: on, off - Show sort options
- Adds a Sort button to the table that gives users sorting options.
Provided values: on, off - Show column options
- Adds a Columns button to the table for displaying, hiding, or reorganizing table columns.
Provided values: on, off - Has date range filter
- Adds a date range filter to the table.
Provided values: on, off - Is Visible
- Determines whether the component is visible to the end-user. In edit mode, all components remain visible.
Provided values: on, off
Events
- Event
- Values: pageChange, tableRowClick
- Reaction
- Values: download file, open modal, close modal, open side panel, close side panel, set component state, set state variable value, toast notification, trigger action, custom
- State Functions
- fetch
Example: See events. - setSelectedRow
Examples:table0.setSelectedRow(0)
sets the selectedRow
property of table0
to the first row.table0.setSelectedRow(null)
clears the selectedRow
property.
- setPageIndex
Example: table0.setPageIndex(0)
sets the pageIndex
property of table0
to the first page.
For more information on events, see Events.
Inspect data
Displays property and value pairs in JSON format.
Example
To view this component in context, see the Metrics Explorer & Monitors Builder app blueprint.
For examples showing how to use advanced features of tables, see Tables.