🌐
GitHub
github.com › reside-ic › TreeTables
GitHub - reside-ic/TreeTables: :deciduous_tree: jQuery plugin extending jquery-datatables to support tree data
$('#my-table').DataTable() .order([ 2, 'asc' ]) .draw(); Additionally the TreeTable plugin exposes API methods for collapsing and exanding rows via $('#myTable').data('treeTable')
Starred by 26 users
Forked by 11 users
Languages   JavaScript 94.4% | CSS 3.0% | SCSS 2.6% | JavaScript 94.4% | CSS 3.0% | SCSS 2.6%
Discussions

Select Datatable Row In Tree Table Plugin - Stack Overflow
I found a plugin which creates a hierarchal tree structure in data tables. The bonus here, is unlike most alternatives, it keeps the parent reference in the child rather than the other way around. ... More on stackoverflow.com
🌐 stackoverflow.com
JSTree with Datatables - javascript
I have two columns on a page, with a checkbox jstree on the left and a table using datatables on the right. The table rows and tree are all loaded at startup. I would like to show a row when the n... More on stackoverflow.com
🌐 stackoverflow.com
Tree table in jquery with multi level children
And i want to create a tree table and if the children of parent have no data, i create a rowspan and write it No data . ... @Prassad Wagrad very thanks but your datatable example doesn't do exactly what i want.. More on stackoverflow.com
🌐 stackoverflow.com
TreeTable in Datatables — DataTables forums
Hello. I write small code for hierarchical data in datatables. May be it helps to someone. TreeTableCode TreeTable More on datatables.net
🌐 datatables.net
December 11, 2014
🌐
Culmat
culmat.github.io › jsTreeTable
jsTreeTable
We cannot provide a description for this page right now
🌐
GitHub
github.com › royling › jquery.dataTables.TreeTable
GitHub - royling/jquery.dataTables.TreeTable: Integrate jquery.treeTable into jquery.dataTables
$('#example').dataTable({ "sDom": "Ttfr", "oTreeTable": { "fnPreInit": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { // This function will be registerd as "aoRowCallback" of jquery.dataTables, // thus it has the same signature as "fnRowCallback". // Specify "id" & "class" attributes for each row (TR) required by jquery.treeTable: // for parent rows, add class 'parent'; // for children rows, add a class with name of prefix - 'child-of-' and parent id }, "showExpander": true, // The other settings to override the default options of jquery.treeTable, e.g.
Starred by 28 users
Forked by 12 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
jQuery Script
jqueryscript.net › jquery plugins › jquery table plugins
jQuery Plugin For Displaying A Tree Of Data In A Table - treetable | Free jQuery Plugins
November 25, 2020 - treetable is a lightweight jquery plugin that allows you to display a tree of data in an HTML table that's good for creating a directory structure or a nested list.
🌐
npm
npmjs.com › package › treetables
treetables - npm
June 2, 2021 - TreeTables is a jQuery plugin that enhances the functionality of the popular DataTables plugin.
      » npm install treetables
    
Published   Jun 02, 2021
Version   1.2.1
Author   Alex Hill
🌐
JSFiddle
jsfiddle.net › royling › zg9q6sjd
jquery.dataTables.TreeTable live example - JSFiddle - Code Playground
JSFiddle - Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle.
🌐
Stack Overflow
stackoverflow.com › questions › 41864405 › jstree-with-datatables
JSTree with Datatables - javascript
var $tableRows = $('#yourTableId').find('tr'); $('#yourTreeContainer').on('select_node.jstree', function(e, data) { $tableRows.each(function() { if (this.id === '#row-' + data.node.id) { $(this).removeClass('HiddenRow'); } else { $(this).addClass('HiddenRow'); } }); }); ... Sign up to request clarification or add additional context in comments. ... I created same with some changes and it works fine, but even with hidden row I don't want datatable showing empty pages. Any advice, please? ... $('#jstree') .jstree({ core: { data: treeData }, checkbox: { three_state : false, // to avoid that fact
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 59654298 › tree-table-in-jquery-with-multi-level-children
Tree table in jquery with multi level children
Have a look at the url: datatables.net/forums/discussion/50218/… which gives a working example fiddle: live.datatables.net/sawapoci/1/edit . That example shows table inside table, in that example child table too made as datatable which you can skip & keep that as a normal table by just commenting code lines $('#child_details').DataTable({ destroy: true, scrollY: '100px' });
🌐
DataTables
datatables.net › forums › discussion › 25045 › treetable-in-datatables
TreeTable in Datatables — DataTables forums
December 11, 2014 - Hello. I write small code for hierarchical data in datatables. May be it helps to someone. TreeTableCode TreeTable
🌐
GitHub
github.com › ludo › jquery-treetable
GitHub - ludo/jquery-treetable: jQuery plugin to show a tree structure in a table · GitHub
jQuery plugin to show a tree structure in a table. Contribute to ludo/jquery-treetable development by creating an account on GitHub.
Starred by 751 users
Forked by 270 users
Languages   HTML 84.2% | JavaScript 14.8% | CSS 1.0%
🌐
DataTables
datatables.net
DataTables | Javascript table library
Full Getting Started Guide · DataTables is a Javascript HTML table enhancing library. It is a highly flexible tool, built upon the foundations of progressive enhancement, that adds all of these advanced features to any HTML table
🌐
GitHub
github.com › shingos › datatables-treetable › blob › master › examples › index.html
datatables-treetable/examples/index.html at master · shingos/datatables-treetable
It combines the jQuery treetable to DataTables, and then realized the Tree display having a function of DataTables and jQuery treetable. - shingos/datatables-treetable
Author   shingos
🌐
jQuery Script
jqueryscript.net › blog › best-tree-table.html
10 Best Tree Table Plugins In JavaScript (2026 Update) | jQuery Script
November 25, 2020 - A lightweight jquery plugin that allows you to display a tree of data in an HTML table that's good for creating a directory structure or a nested list.
🌐
Cubicphuse
ludo.cubicphuse.nl › jquery-treetable
jQuery treetable
To make the tree actually display as a tree you have to add data-tt-id and data-tt-parent-id attributes to your table rows (tr). First, you should add a unique data-tt-id attribute to each of the rows in your table, for example 'node-x'. Then you add a data-tt-parent-id attribute to each child ...
🌐
JQuery
plugins.jquery.com › treetable
jQuery treetable | The jQuery Plugin Registry
jQuery plugin for displaying a tree structure in a (HTML) table, i.e.
🌐
DataTables
datatables.net › forums › discussion › 37972 › datatables-and-display-collapse-expand-of-a-tree-view
DataTables and display/collapse/expand of a tree view — DataTables forums
September 25, 2016 - $(".dataTable").dataTable({ ...<your other options>... fnStateLoadCallback: function(settings){ // Code to load the table state from a data source of your choice, // i use a server side component that adds a data attribute for the state var state = this.data("state") || {}; if (state.collapsed) settings.aCollapsed = state.collapsed; return state; }, fnStateSaveParams: function(settings,state){ if (settings.aCollapsed) state.collapsed = settings.collapsed; } });
Top answer
1 of 2
1

Format your HTML properly with <tr>...</tr> around <th>..</th> (& end <th> properly as shown) & add <thead>..</thead> around head & <tbody>...</tbody> around body and add code to auto add missing <td></td>:

$(document).ready(function() {
    // Add missing <td></td> according to number of columns found in head
    var numTd = $('th').length;
    console.log('Number of columns found in head =: ', numTd);
    $('tbody tr').each(function()
    {
        var i = $(this).find('td').length;
        while(i < numTd)
        {
            $(this).append('<td></td>');
            i++;
        }
    });
    
    $('.tree').DataTable();
} );
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" />
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.1.1/css/responsive.dataTables.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/responsive/2.1.1/js/dataTables.responsive.min.js"></script>

<table class="tree display responsive no-wrap">
  <thead>
    <tr>
    <th>name</th>
    <th>class</th>
    <th>Remark</th>
    <th>xyz</th>
    <th>zyz</th>
    <th>zyz</th>
    </tr>
  </thead>
  <tbody>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigThing</td>
    <td>somethigvalue</td>
   <td>somethigThing</td>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    <td>somethigThing</td>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
  </tbody>
</table>

2 of 2
0

You can use Bootstrap for creating responsive table.

Examlpe:

<head>
<meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<div class="table-responsive container">
<table class="table table-inverse">
  <tbody>
  <th>name<th>
  <th>class<th>
  <th>Remark<th>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
    <tr>
    <td>somethigThing</td>
    <td>somethigThing</td>
    <td>somethigvalue</td>
    </tr>
  </tbody>
  </table>
  </div>

🌐
Stack Overflow
stackoverflow.com › questions › 22411365 › implementation-of-jquery-data-tale-with-tree-view-from-server-side › 31666339
treeview - Implementation of Jquery Data Tale with Tree View from server side - Stack Overflow
There is no example for how implement tree view with serverside json response in datatable. Please guide me how to achieve this. ... I was the owner of the plugin, just found this question redirected from github. Did you already figure it out? In fact, no special requirement to the server response, just use whatever as you like. However, in order to make this work, you need to implement fnPreInit callback to tell the parent/children relationship to the plugin, which is actually required by the jquery tree table plugin.