UITABLE creates a 2D graphic uitable as an alternative to MATLAB 7's UITABLE (MATLAB 6.5, no-JAVA mo
Updated 26 May 2006

No License

UITABLE creates a two dimensional graphic uitable
This is an alternative to MATLAB 7's UITABLE. It will work with MATLAB 6.5 and also in no-JAVA mode.

This was developed based on the functions "tableGUI" by Joaquim Luis (2006-02-17) and "Editable Table in MATLAB" by Morris Maynard (2005-01-17) which are both available from the MATLAB Central File Exchange.


data = uitable(rand(3,2));

%Creates a 3x2 modal uitable in a new figure window.

hAxes = axes('units','pixels','position',[45 45 400 140]);
a = uitable(hAxes, cell(3,12));

%Creates an empty 3x12 modal uitable in the axes specified by hAxes

modal: 0 or 1 specifying modal state
nVisibleRows: int specifying number of visible rows
nVisibleCols: int specifying number of visible columns
colLabels: 0, 1, or cell array of strings for column labels
checkBoxes: 0, 1, or vector of int for check boxes
rowNumbers: 0 or 1 for row numbers

disabledColumns: [] or vector of int for preventing column editing
colWidth: 1 or vector of int for indicating relative column widths
highlightCell: 0 or 1 -- highlight selected cell
highlightRow: 0 or 1 -- highlight row of selected cell
highlightCol: 0 or 1 -- highlight column of selected cell
fontsize: int for font size
precision: s for formatting data (see fprintf)

The main features of this UITABLE implementation are:
(1) Axes-defined table size. This makes it convenient for use with GUIDE and general GUI use.
(2) Modal/non-modal behavior. Can use within larger GUI or as stand-alone.
(3) Vertical and horizontal sliders. User controls how many cells to show.
(4) Row checkboxes. Optional specification for number of check boxes.
(5) Highlighting. Cells, rows, columns highlighting options exist.
(6) Column disabling. Prevent editing of specified data columns.

Its main disadvantages are:
(1) Large tables (> 400 cells) may require substantial refresh duration when scrolling.
(2) Table implemented as a set of uicontrols. User must be cautious with commands like findobj('type','uicontrol').
(3) If highlighting is enabled, WINDOWS users must click on a cell twice to edit its contents. Single clicking suffices in UNIX. Refer to ?MATLAB functions: uicontrol? in MATLAB help.

Cite As

Todd Pataky (2024). uitable (https://www.mathworks.com/matlabcentral/fileexchange/11201-uitable), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Migrate GUIDE Apps in Help Center and MATLAB Answers

Inspired by: Editable Table in MATLAB

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes