Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
table-sort-js
Advanced tools
A JavaScript client-side HTML table sorting library with no dependencies required.
Description: A JavaScript client-side HTML table sorting library with no dependencies required.
Download: https://leewannacott.github.io/table-sort-js/table-sort.js
class="table-sort"
to HTML table tags. Click on column headers to sort.table classes | Description |
---|---|
"table-sort" | Make the table sortable! (Words, numbers, dates) |
"table-arrows" | Display ascending or descending triangle. |
th classes | Description |
---|---|
"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) |
npm install table-sort-js
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;
Download: https://leewannacott.github.io/table-sort-js/table-sort.js
<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>
<thead>
does not exist it will be created by using data from first row. <tbody>
is optional.FAQs
A JavaScript client-side HTML table sorting library with no dependencies required.
The npm package table-sort-js receives a total of 1,545 weekly downloads. As such, table-sort-js popularity was classified as popular.
We found that table-sort-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.