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

NameDescriptionDatatypeDefault
numRowsNumber of rows in the table.Integer3
numColsNumber of columns in the table.Integer3
rowsPer row, the components it contains. Can be easily set with the setContent method.Component
headerHeaders of the columns of the table.Array/list of strings
stripedWhether or not the table rows should be striped.BooleanFalse
borderedWhether or not the table should contain cell borders.BooleanFalse
hoverWhether a row should be highlighted when it is hovered over.BooleanFalse
condensedWhether or not the table should be condensed (compact).BooleanFalse
cellAlignmentAlignment of content within the cells of the table.BooleanFalse
tableViewWhen true and the component is part of an EditGrid, the component's value is shown (simplified) in the collapsed row of the EditGrid.BooleanFalse

Methods

NameSyntaxDescription
setContentobj​.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 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.
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.
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.