tablesort

WebJar for tablesort

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

tablesort
Last Version

Last Version

5.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

tablesort
WebJar for tablesort
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/tristen/tablesort

Download tablesort

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/tablesort/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>tablesort</artifactId>
    <version>5.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/tablesort/
implementation 'org.webjars.npm:tablesort:5.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/tablesort/
implementation ("org.webjars.npm:tablesort:5.2.0")
'org.webjars.npm:tablesort:jar:5.2.0'
<dependency org="org.webjars.npm" name="tablesort" rev="5.2.0">
  <artifact name="tablesort" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='tablesort', version='5.2.0')
)
libraryDependencies += "org.webjars.npm" % "tablesort" % "5.2.0"
[org.webjars.npm/tablesort "5.2.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

tablesort

A small & simple sorting component for tables written in JavaScript.

npm version Build Status

Quick start

Download the ZIP of this repository or install via command line:

npm install tablesort 
# Or if you're using Yarn 
yarn add tablesort 
<script src='tablesort.min.js'></script>

<!-- Include sort types you need -->
<script src='tablesort.number.js'></script>
<script src='tablesort.date.js'></script>

<script>
  new Tablesort(document.getElementById('table-id'));
</script>

See usage and demos for more


Browser Support

Chrome logo Firefox logo Internet Explorer logo Opera logo Safari logo
8+ 3.6+ 10+ 11.50+ 5.1+

Node/Browserify

// npm install tablesort
var tablesort = require('tablesort');

tablesort(el, options);

Default CSS

Add the styling from tablesort.css file to your CSS or roll with your own.

Extending Tablesort

If you require a sort operation that does not exist in the sorts directory, you can add your own.

Tablesort.extend('name', function(item) {

  // Regular expression to test against.
  // `item` is a table value to evaluate.
  return /foo/.test(item);
}, function(a, b) {

  // Custom sort functionality goes here.
  // e.g var n = (a > b) ? -1 : 1;
  return n;
});

If you've made an extend function that others would benefit from pull requests are gladly accepted!

Contributing

Tablesort relies on Grunt as its build tool. Simply run npm run build to package code from any contributions you make to src/tablesort.js before submitting pull requests.

Tests are run via:

npm install && npm test

Licence

MIT

Bugs?

Create an issue

Versions

Version
5.2.0