SimpleDataTable

Example 1: Minimal


const t = new SimpleDataTable(document.querySelector('#example-1'));
t.load(...);
t.render();
    

Example 2: Change label of add button


const t = new SimpleDataTable(document.querySelector('#example-2'), {
    addButtonLabel: 'Add'
});
t.load(...);
t.render();
    

Example 3: Change prefix of default column (use DevTools to watch)


const t = new SimpleDataTable(document.querySelector('#example-3'), {
    defaultColumnPrefix: 'col-'
});
t.render();
    

Example 4: Change default number of columns


const t = new SimpleDataTable(document.querySelector('#example-4'), {
    defaultColumnNumber: 1
});
t.render();
    

Example 5: Readonly Mode


const t = new SimpleDataTable(document.querySelector('#example-5'), {
    readonly: true
});
t.render();
    

Example 6: Headers + Sorting


const t = new SimpleDataTable(document.querySelector('#example-6'));
t.setHeaders(['Value', 'Color', 'Name']);
t.load(...);
t.render();
t.sortByColumn(0);