GUIKit`
GUIKit`

"Table"

The functionality provided by GUIKit has been superseded by the interface construction and controls functions native to the built-in Wolfram Language.

Widget["Table"]

represents a table.

Details

  • To use Widget["Table"], you first need to load GUIKit using Needs["GUIKit`"].
  • By default, all cells are editable. All cells in Widget["DisplayOnlyTable"] are noneditable.
  • By default, most data stored in tables will be strings and left-aligned within the cells. However, it is possible to store, display, and retrieve Booleans, numbers, and images within table columns with more native controls using checkboxes, right-aligned text, and icons, respectively.
  • To display images, you will need to set "columnEditable" to False to avoid corrupting the original images.
  • It is important that all data within a given column match either the first row's types or the "prototype" property types if specified, because tables currently do not support rendering different data types on different rows within the same column.
  • The following properties are available:
  • "items"{}the contents of the table
    "tableHeader"Nullthe table header
    "rowSelectionAllowed"Truewhether each row can be selected
    "columnSelectionAllowed"Falsewhether each column can be selected
    "columnEditable"Nullwhether cells in each column can be edited
    "columnSortable"Nullwhether each column can be sorted by clicking the header
    "prototype"Nullhow to format a typical row of data
    "model" the model that intercedes between the user interface and the data in the table

Examples

open allclose all

Basic Examples  (1)

Create a basic table inside a scroll view:

Get the entire table contents:

Get and set individual rows:

Change the column headers:

Use the "model" component to add rows:

Add columns:

Remove rows:

Query and change individual cells:

Properties & Relations  (4)

Table Headers  (1)

Set the "tableHeader" property to Null to suppress display of column headers:

Editability  (1)

Always set "columnEditable" to False if displaying images:

Allow only the Boolean checkbox column to be editable:

Sorting  (1)

Allow sorting of just the first two columns:

After re-sorting:

Print the new ordering whenever the sort order is changed (useful for re-sorting externally stored data):

Data Types  (1)

Construct a table with Booleans in the first column and numbers in the third:

Get the values in appropriate forms:

Use the "prototype" property to override the default rendering for a data type:

Interactive Examples  (1)

Set up a binding to know when changes are made in the table:

Update a value and add a row: