Advanced Table

Short Description

Generates more advanced tables that support sorting, searching and pagination. Several options are available to customize those features and the appearance.

Example Code

<div id="table-ask-query" class="plastic-js" style="height: auto; width: 100%;">

    <script class="plastic-data" data-url="/docs/_static/data/default.json" data-format="default"></script>

    <script class="plastic-options" type="application/json">
        {
            "benchmark": true
        }
    </script>

    <script class="plastic-display" data-module="advanced-table" type="application/json">
        {
            "tableClasses": "table table-condensed smaller-font",
            "paging": true,
            "searching": true,
            "ordering": true,
            "orderMulti": true
        }
    </script>

</div>

Live Example

Example Data

Link to the JSON file - click here.

Dependencies

Note

plastic.js manages the dependencies automatically. There is no need to include them manually, but you can do so if you want.

Available Options

This example snippet contains all available options with their default values:

<script class="plastic-display" data-module="advanced-table" type="application/json>
    {
        "tableClasses": ""
        "paging": false
        "lengthMenu": [[10,25,50,100,-1],[10,25,50,100,"All"]]
        "searching": true
        "ordering": true
        "orderMulti": true
    }
</script>

Properties details:

Table Classes

DescriptionTable CSS Classes
KeywordtableClasses
Typestring
"tableClasses": ""

Paging

DescriptionEnable Pagination of Table Elements
Keywordpaging
Typeboolean
"paging": false

Menu Length

DescriptionSets the available number of entries in the dropdown menu. Takes an 2dim array.
KeywordlengthMenu
Typearray
Default[[10,25,50,100,-1],[10,25,50,100,"All"]]
"lengthMenu": [[10,25,50,100,-1],[10,25,50,100,"All"]]

Searching

DescriptionEnable Searching of Table Elements
Keywordsearching
Typeboolean
Defaulttrue
"searching": true

Ordering

DescriptionFeature control ordering (sorting) abilities in DataTables.
Keywordordering
Typeboolean
Defaulttrue
"ordering": true

Multiple Ordering

DescriptionMultiple column ordering ability control.
KeywordorderMulti
Typeboolean
Defaulttrue
"orderMulti": true