JavaScript Treetable

This treetable requires just two things:

  1. an attribute "data-tree-level" in every table row, giving the 0-n tree level of that row,
  2. that the rows are in a depth-first tree traversal order.

The default tree column will be the first one (index 0), the default expansion state will be collapsed.

Mind the different expand controls, configurable via JS.
Mind also that expanding the tree does not resize the table columns.

See HTML and JS source code on page bottom.

Item Chapter PI
Item 1 1 3.14159 26535
Item 2 1.1 3.14159 26535
Item 3 1.1.1 3.14159 26535
Item 4 1.1.2 3.14159 26535
Item 5 1.1.2.1 3.14159 26535
Item 6 1.1.2.2 3.14159 26535
Item 7 1.2 3.14159 26535
Item 8 2 3.14159 26535
Item 9 2.1 3.14159 26535



Click here to view page source.

ɔ⃝ Fritz Ritzberger, 2015-03-27