Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

table-sort-js

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

table-sort-js

A JavaScript client-side HTML table sorting library with no dependencies required.

  • 1.4.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
decreased by-9.92%
Maintainers
1
Weekly downloads
 
Created
Source

table-sort-js table-sort-js table-sort-js table-sort-js table-sort-js

TABLE-SORT-JS.

  • Description: A JavaScript client-side HTML table sorting library with no dependencies required.

  • Demo

  • Documentation. (work in progress)

  • npm package.

Install instructions - pick one option.

  1. Install from npm: npm install table-sort-js
import tableSort from "table-sort-js/table-sort.js";

Refer to the documentation for examples on using table-sort-js with frontend frameworks such as ReactJS.

  1. Download table-sort.js (Select save as.)

Then add the following script before your HTML table:

<script src="table-sort.js"></script>

Refer to the documenation for examples how to use table-sort-js with HTML.

To make a table sortable:
  • Add class="table-sort" to HTML <table> tags. Click on the columns heads to sort.
Classes:
table classesDescription
"table-sort"Make the table sortable! (Words, numbers, dates)
"table-arrows"Display ascending or descending triangles.
"remember-sort"If clicking on different columns remembers sort of the original column.
th classesDescription
"order-by-desc"Order by descending on first click. (default is aescending)
"file-size"Sort file sizes(B->TiB) uses the binary prefix. (e.g KiB)
"data-sort"Sort by data attributes, e.g <td data-sort="42">
Notes:
  • Makes use of natural sorting to sort numerical values correctly.
  • If <thead> does not exist it will be created by using data from first row. <tbody> is optional.
Development:

If you wish to contribute, install instructions can be found here.

Keywords

FAQs

Package last updated on 28 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc