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.0.2
  • Source
  • npm
  • Socket score

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

table-sort-js

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

npm install table-sort-js and require("../node_modules/table-sort-js/table-sort.js")

OR

<script src="https://leewannacott.github.io/table-sort-js/table-sort.js">

Example of table using table-sort-js:

<script src="https://leewannacott.github.io/table-sort-js/table-sort.js"></script>

<table class="table-sort">
        <thead>
          <tr>
            <th>Last Name</th>
            <th>First Name</th>
            <th class="order-by-desc">Birth Date</th>
            <th>Employee ID</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>Smith</td>
            <td>John</td>
            <td>1977</td>
            <td>1</td>
          </tr>
          <tr>
            <td>Bach</td>
            <td>Frank</td>
            <td>1976</td>
            <td>10</td>
          </tr>
          <tr>
            <td>Doe</td>
            <td>Jason</td>
            <td>1978</td>
            <td>100</td>
          </tr>
        </tbody>
</table>

Notes:

class="order-by-desc"for <th> to change default sort to descending order on first click.

If <thead> does not exist it will be created by using data from first row. <tbody> is optional.

Keywords

FAQs

Package last updated on 17 Jan 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