A Javascript library making HTML tables filterable and a bit more
npm install tablefilter




shell
git clone https://github.com/koalyptus/TableFilter.git
`
* You can download this repository.
* TableFilter is available on npm repository, you can install it from the command line using the following command:
`shell
npm install tablefilter --save-dev
`
* or get the future features from the next release channel:
`shell
npm install tablefilter@next --save-dev
`
* Alternatively you can also access these files from unpkg CDN, download them or point your package manager to them.
Setup
$3
Require TableFilter:
`javascript
// ES2015 modules
import TableFilter from 'tablefilter';
// CommonJS or AMD modules
var TableFilter = require('tablefilter');
`
$3
If you are not using a module system, you can reference the distribution scripts directly in your html pages:
`html
`
$3
Copy the tablefilter directory under dist and place it at desired location in your project. Then include the main js file in your page:
`shell
`
$3
Place the following snippet just under the HTML table and always define a base_path property in the configuration object to reflect the path to the script
`shell
`
If the base_path property is not specified, it will default to /tablefilter directory:
`shell
your-page.html
|— tablefilter
`
Development
This project requires node.js and Grunt to be installed:
- install node.js v8.9.4 or higher
- install Grunt from the command line using npm (comes with node.js):
`shell
npm install -g grunt-cli
`
Once Grunt is sorted out you can follow the instructions below.
Start by installing any dependencies.
`shell
npm install
`
Use
`shell
npm run dev
`
command to launch a build / watch cycle and start the local
sever on port 8080.
Use
`shell
npm run build
`
command to generate a production build.
The
`shell
npm run dist
`
command will create a production build, run the tests and finally generate
the demos:
To run all the tests and generate the coverage report:
`shell
npm test
`
or to run specific test(s):
`shell
grunt test-only:test.html
grunt test-only:test.html,test-sort.html
`
to view the coverage report(s), open the index.html under the
report/coverage folder or
online.
Demos
Check out the online examples
or generate the demos locally:
`shell
npm run build:demos
`
then run the local webserver:
`shell
npm start
`
then pick a demo from:
`shell
http://localhost:8080/demos/
`
Documentation
Find exhaustive documentation on the configuration options in the WIKI section.
Autogenerated documentation of the ES6 modules is available on the website: docs
If you previously used the HTML Table Filter Generator plugin, verify the configuration
options you are using are still supported: Obsolete
Run this task to generate the documentation in the docs/docs directory:
`shell
npm run esdoc
``