Coder Social home page Coder Social logo

hanylovescode / table-sort-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leewannacott/table-sort-js

0.0 0.0 0.0 2.03 MB

HTML table sorting library written in VanillaJS.

Home Page: https://leewannacott.github.io/table-sort-js/table-sort.js

License: MIT License

HTML 42.75% JavaScript 51.03% CSS 6.22%

table-sort-js's Introduction

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

TABLE-SORT-JS.

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 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)

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.

table-sort-js's People

Contributors

aliosman21 avatar anupshrestha11 avatar erlliam avatar hanylovescode avatar leewannacott avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.