Skip to content

Pure JavaScript (VanillaJS) component that transforms simple html tables, into fully-interactive and accessible datatables with sorting, searching and paging features.

License

Notifications You must be signed in to change notification settings

luverolla/js-datatable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JS DataTable

Pure JavaScript (VanillaJS) component that transforms simple html tables, into fully-interactive and accessible datatables with sorting, searching and paging features.

How to use

To use the datatable plugins, two main file must be included. The stylesheet:

<link rel="stylesheet" href="/js-datatable/dist/css/datatable.min.css" />

And the script file (inclusive of all language files)

<script src="/js-datatable/dist/datatable.min.js"></script>

The table must be wrapped correcty as the following example

<table data-replace="jtable" data-search="true" data-locale="en">
    <thead>
        <tr>
            <th>Name</th>
            <th>Surname</th>
            <th>Age</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Mario</td>
            <td>Rossi</td>
            <td>20</td>
        </tr>
    </tbody>
</table>

Options

attribute name data type description
data-locale string lowercase two-letters ISO language code
data-search boolean tells if table should be searchable

Languages

At the time I'm writing this document, there are only Italian (it) and English (en) available.
I don't use automatic translators. I prefer filling only languages that I know.
Other translation can be easily added in the /src/locales.js file.
Remeber to use the correct ISO two-letter code. See here

About

Pure JavaScript (VanillaJS) component that transforms simple html tables, into fully-interactive and accessible datatables with sorting, searching and paging features.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published