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 - npm Package Compare versions

Comparing version 1.3.7-b to 1.3.7-c

2

package.json
{
"name": "table-sort-js",
"version": "1.3.7-b",
"version": "1.3.7-c",
"description": "A JavaScript client-side HTML table sorting library with no dependencies required.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -7,15 +7,30 @@ ![table-sort-js](https://img.shields.io/npm/v/table-sort-js)

## table-sort-js.
## TABLE-SORT-JS.
- Description: A JavaScript client-side HTML table sorting library with no dependencies required.
- Demo: https://leewannacott.github.io/Portfolio/#/GitHub.
- [Demo](https://leewannacott.github.io/Portfolio/#/GitHub)
- [Documentation.](https://leewannacott.github.io/TABLE-SORT-JS/docs/about.html)
(work in progress)
- [npm package.](https://www.npmjs.com/package/table-sort-js)
## Install instructions - pick one option.
- Download: https://leewannacott.github.io/table-sort-js/table-sort.js
1. Install from npm: ` npm install table-sort-js`
- NPM: https://www.npmjs.com/package/table-sort-js.
```javascript
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.](https://leewannacott.github.io/TABLE-SORT-JS/docs/react.html)
#### Instructions:
- Add `class="table-sort"` to HTML table tags. Click on column headers to sort.
2. [Download table-sort.js](https://leewannacott.github.io/TABLE-SORT-JS/table-sort.js) (Select save as.)
Then add the following script before your HTML table:
```html
<script src="table-sort.js"></script>
```
Refer to the documenation for examples how to use TABLE-SORT-JS with [HTML.](https://leewannacott.github.io/TABLE-SORT-JS/docs/html5.html)
#### To make a table sortable:
- Add `class="table-sort"` to HTML &lt;table&gt; tags. Click on the columns heads to sort.
#### Classes:

@@ -33,78 +48,2 @@

#### Example using npm and ReactJS:
##### Install :`npm install table-sort-js`
```javascript
import React, { Component } from "react";
import tableSort from "table-sort-js/table-sort.js";
export class App extends Component {
componentDidMount() {
tableSort()
}
render(){
return(
<div>
<table className="table-sort">
<thead>
<tr>
<th>Alphabet</th>
<th className="order-by-desc">Order</th>
</tr>
</thead>
<tbody className="table-hover">
<tr>
<td>Alpha</td>
<td>1</td>
</tr>
<tr>
<td>Bravo</td>
<td>2</td>
</tr>
<tr>
<td>Charlie</td>
<td>3</td>
</tr>
</tbody>
</table>
</div>
);
}
}
export default App;
```
##### HTML Example:
Download: https://leewannacott.github.io/table-sort-js/table-sort.js
```html
<script src="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>
</tr>
</thead>
<tbody>
<tr>
<td>Franklin</td>
<td>Benjamin</td>
<td>1706/1/17</td>
</tr>
<tr>
<td>Carnegie</td>
<td>Andew</td>
<td>1835/11/25</td>
</tr>
<tr>
<td>Twain</td>
<td>Mark</td>
<td>1835/11/30</td>
</tr>
</tbody>
</table>
```
#### Notes:

@@ -111,0 +50,0 @@

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