## Table

A table widget that works like a spread sheet. It can be editable at run time, for example insert or delete a row or column, modify cell text. It is designed to be used in scripts.

The table widget cannot connect to PVs directly, but this can be realized by using script. See example below:

Above examples can be found at BOY Examples->widgets->4_5_Table.opi

### Operations

If `Editable` property is true, every cell text of the table can be directly modified at run time by clicking on it. With its context menu, you are able to

- Auto Size Columns
- Insert Column
- Insert Row
- Delete Column
- Delete Row

### Special Properties

- Editable (editable). True if the table cell is editable. If false, it is still selectable, which is different with false `Enabled` property.
- Columns Count (columns_count). Count of columns.
- Column Headers (column_headers). Configure the header text, column width, editable and cell editor type for each column. If the cell editor type is DROPDOWN, the dropdown items should be set from script, for example:

      	from array import array
      	from java.lang import String

      	table = widget.getTable()
      	table.setColumnCellEditorData(2,array(String, ["apple","banana","orange"]))

  If the cell editor type is CHECKBOX, the boolean strings can also be set from script, for exmaple:

      	from array import array
      	from java.lang import String

      	table = widget.getTable()
      	table.setColumnCellEditorData(2,array(String, ["On", "Off"]))

  If the cell editor type is CUSTOMIZED, user should set the cell editor using:

      	 widget.getTable().setColumnCellEditor(2, customizedCellEditor)

- Column Header Visible (column_header_visible). Visibility of column header.
- Default Content (default_content). Default content of the table.

### See Also

- Properties Common to All Widgets

### Special Methods

#### getTable

    public SpreadSheetTable getTable()

  Get the native spread sheet table wrapped by this widget. Script has full access to the returned SpreadSheetTable at run time.

  Returns:
    the native spread sheet table.

#### setAllowedHeaders

    public void setAllowedHeaders(String[] headers)

  Set allowed header titles. If this is set, the insert column dialog will have a combo box instead of text for title input

  Parameters:
    `headers` - The allowed headers.