View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
treeTable - create a sortable table control with collapsible row groups

5.0 | 6 ratings Rate this file 18 Downloads (last 30 days) File Size: 66.8 KB File ID: #42946 Version: 1.3
image thumbnail

treeTable - create a sortable table control with collapsible row groups


Yair Altman (view profile)


05 Aug 2013 (Updated )

Create a sortable Java-based tree-table GUI control having collapsible/expandable data row groups

| Watch this File

File Information

   htable = treeTable (pnContainer, headers, data, 'PropName',PropValue, ...)

Input parameters:
   pnContainer - optional handle to container uipanel or figure (default: gcf)
   headers - optional cell array of column header strings
   data - optional numeric or cell array of data values
   'PropName',PropValue - optional list of property-value pairs: Container, Headers, Data, IconFilenames, ColumnTypes, ColumnEditable, Groupable, InteractiveGrouping

   (see internal help section for details)

Output parameters:
   htable - handle to Java tree-table object

Important features:
   * Table is fully sortable (multiple columns via ctrl-click on header)
   * Table can be flat or hierarchical (grouping)
   * Interactive grouping (like in Outlook)
   * Editable drop-down (selector) option
   * Table columns are automatically resized to fit the available width
   * Table columns are rearrangeable by dragging the headers right/left
   * Table columns can be resized by dragging their divider gridlines (not just the header)
   * User-defined icons for leaf rows and grouping rows (expanded/collapsed)
   * Sample data update and row selection callbacks included; user can attach custom callbacks

   This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7+, but use at your own risk!

Bugs and suggestions:
   Please send to Yair Altman (altmany at gmail dot com)

Technical details of the implementation can be found at


Java Based Data Table inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
16 Aug 2015 Christopher Jackson

Is it possible for the tree table to be able to allow users to add data rows for any label?

Comment only
31 Jan 2015 Yair Altman

Yair Altman (view profile)

@Ramiro - this would probably require a dedicated Java cell-renderer for the table column.

Comment only
30 Jan 2015 Ramiro Massol

hi Yair, is it possible to customize each node of treetable? let's say, have different icons for specific nodes?
Is it possible to have different data types under one column of treetable?

12 Mar 2014 Kim

Kim (view profile)


11 Sep 2013 Jan Simon

Jan Simon (view profile)

Dear Yair, there has been a discussion about wanted features for uitree and uitable in the forum:
Your treeTable solves many of the problems mentioned there. I cannot imagine, why TMW hesitates to implement such powerful GUI tools by their own.

08 Aug 2013 Assaf

Assaf (view profile)

Wow! That's amazing. Very useful. Great job!

08 Aug 2013 852053843

This is great! One thing I noticed: When I enter "-0" in the Numeric column, it is not changed to "0". Is this intended behaviour? Also, when I move the first column, the folder symbols and labels are separated.

06 Aug 2013 Sven

Sven (view profile)

Add this to the It Simply Works(TM) suite of tools.

06 Aug 2013 1.2

Added InteractiveGrouping option to enable interactive column grouping as in Microsoft Outlook

06 Aug 2013 1.3

Forgot a couple of important Java files in the previous uploads, sorry about that...

Contact us