The Table component
Position components in a table.
In addition to the properties and methods listed below, this component inherits properties and methods from the superclass Component
. For example, any Table component has a label
and hidden
property even though these are not explicitly listed here.
Properties
Name | Description | Datatype | Default |
---|---|---|---|
numRows | Number of rows in the table. | Integer | 3 |
numCols | Number of columns in the table. | Integer | 3 |
rows | Per row, the components it contains. Can be easily set with the setContent method. | Component | |
header | Headers of the columns of the table. | List/Array of strings | |
striped | Whether or not the table rows should be striped. | Boolean | False |
bordered | Whether or not the table should contain cell borders. | Boolean | False |
hover | Whether a row should be highlighted when it is hovered over. | Boolean | False |
condensed | Whether or not the table should be condensed (compact). | Boolean | False |
cellAlignment | Alignment of content within the cells of the table. | Boolean | False |
tableView | When true and the component is part of an EditGrid, the component's value is shown (simplified) in the collapsed row of the EditGrid. | Boolean | False |
Methods
Name | Syntax | Description |
---|---|---|
setContent | obj.setContent(content) | Add components to the table by providing them in an array, with every element of the array containing the components/strings to place in the table cells. In Python, the content shall be a list of lists. The outer list shall be the list of rows. The elements of the inner lists can be strings, numbers, components or lists of components. All inner lists must have the same number of elements. In MATLAB, the content shall be a 2D string array (text to display in each of the cells) or a 2D cell array. In case the input is a cell array, each cell shall contain a string, number, component or cell array of components. If a cell/element contains a string or a number, it will be directly displayed in the table. This method assigns the numRows , numCols and rows properties of the component. |
See also
- For tables with more than a few rows, or with a variable number of editable rows, see the DataGrid or the EditGrid components.
- For more info on tables in general, see the Tables section.