{"id":23483339,"url":"https://github.com/kyle-wannacott/table-sort-js","last_synced_at":"2025-04-12T16:43:36.950Z","repository":{"id":40451715,"uuid":"306289602","full_name":"kyle-wannacott/table-sort-js","owner":"kyle-wannacott","description":"HTML table sorting with no dependencies.","archived":false,"fork":false,"pushed_at":"2024-12-25T01:34:36.000Z","size":2438,"stargazers_count":81,"open_issues_count":21,"forks_count":25,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T18:13:21.544Z","etag":null,"topics":["beginner-friendly","html","html-tables","javascript","sort-table","sortable","sorting","table","table-sort","table-sort-js","table-sorting","vanilla-js"],"latest_commit_sha":null,"homepage":"https://cdn.jsdelivr.net/npm/table-sort-js@latest/table-sort.js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyle-wannacott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-22T09:37:17.000Z","updated_at":"2025-04-03T08:37:11.000Z","dependencies_parsed_at":"2024-03-29T17:48:50.097Z","dependency_job_id":"eccceec1-17ed-4fb7-8b30-eb3baea23578","html_url":"https://github.com/kyle-wannacott/table-sort-js","commit_stats":{"total_commits":339,"total_committers":18,"mean_commits":"18.833333333333332","dds":0.6755162241887905,"last_synced_commit":"91b514abb547b1543ef8033804e25404ec878f84"},"previous_names":["kyle-wannacott/table-sort-js"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyle-wannacott%2Ftable-sort-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyle-wannacott%2Ftable-sort-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyle-wannacott%2Ftable-sort-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyle-wannacott%2Ftable-sort-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyle-wannacott","download_url":"https://codeload.github.com/kyle-wannacott/table-sort-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248599696,"owners_count":21131340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beginner-friendly","html","html-tables","javascript","sort-table","sortable","sorting","table","table-sort","table-sort-js","table-sorting","vanilla-js"],"created_at":"2024-12-24T21:05:11.100Z","updated_at":"2025-04-12T16:43:36.932Z","avatar_url":"https://github.com/kyle-wannacott.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![npm version](https://img.shields.io/npm/v/table-sort-js)\n![npm downloads](https://img.shields.io/npm/dm/table-sort-js)\n[![jsDeliver downloads](https://data.jsdelivr.com/v1/package/npm/table-sort-js/badge)](https://www.jsdelivr.com/package/npm/table-sort-js)\n![repo size](https://img.shields.io/github/repo-size/kyle-wannacott/table-sort-js)\n![MIT licence](https://img.shields.io/github/license/kyle-wannacott/table-sort-js)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n![build status](https://img.shields.io/github/actions/workflow/status/kyle-wannacott/table-sort-js/jest.yml?branch=master)\n\n# TABLE-SORT-JS.\n\n- Description: HTML table sorting library with sort type inference builtin and browser extension available. [#VanillaJS](http://vanilla-js.com/)\n\n- [Demo](https://kyle-wannacott.github.io/Portfolio/#/GitHub)\n- [Documentation.](https://kyle-wannacott.github.io/table-sort-js/docs/about.html)\n  (work in progress)\n- [npm package.](https://www.npmjs.com/package/table-sort-js) and [jsDelivr](https://www.jsdelivr.com/package/npm/table-sort-js)\n- [Firefox](https://addons.mozilla.org/en-US/firefox/addon/table-sort-js/) and [Chrome](https://chrome.google.com/webstore/detail/table-sort-js/dioemkojkjhlhmfiocgniipejgkbfibb) browser extensions: Tables of any website you visit become sortable!\n\n## Install instructions.\n\n- \u003cb\u003eOption 1\u003c/b\u003e: Load as script from a Content Delivery Network (CDN):\n\n```javascript\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/table-sort-js/table-sort.min.js\"\u003e\u003c/script\u003e\n```\n\nOr non-minified version (larger size, but easier to debug!):\n\n```javascript\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/table-sort-js/table-sort.js\"\u003e\u003c/script\u003e\n```\n\nExample on how to use table-sort-js with [HTML](https://kyle-wannacott.github.io/table-sort-js/docs/html5.html)\n\n- \u003cb\u003eOption 2:\u003c/b\u003e Install from npm:\n\n```javascript\nnpm install table-sort-js\n```\n\n```javascript\nimport tableSort from \"table-sort-js/table-sort.js\";\n```\n\nExamples on using table-sort-js with frontend frameworks such as [React.js](https://kyle-wannacott.github.io/table-sort-js/docs/react.html) and [Vue.js](https://kyle-wannacott.github.io/table-sort-js/docs/vue.html)\n\n## To make tables sortable:\n\n- Add `class=\"table-sort\"` to HTML \u0026lt;table\u0026gt; tags.\n- Click on table headers to sort columns.\n\n#### Classes:\n\n| \u0026lt;table\u0026gt; classes | Description                                                                                                  |\n| --------------------- | ------------------------------------------------------------------------------------------------------------ |\n| \"table-sort\"          | Make the table sortable! (Words, numbers, dates, file sizes)...                                              |\n| \"table-arrows\"        | Display ascending or descending arrows. Supports custom arrows; for example: \"table-arrows-⇈⇋⇊\"              |\n| \"no-class-infer\"      | Turns off inference for adding sort classes automatically e.g (file-size-sort, dates-dmy-sort), etc.         |\n| \"remember-sort\"       | If clicking on different columns remembers sort of the original column.                                      |\n| \"cells-sort\"          | sort cells (td) rather than table rows (tr); useful for keeping table rows with classes/attributes in place. |\n\n\u003cbr\u003e\n\n| \u0026lt;th\u0026gt; classes | Description                                                                                                                                                             |\n| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| \"data-sort\"        | Sort by [data attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes), e.g \u0026lt;td data-sort=\"42\"\u0026gt;. Useful for doing custom sorts. |\n| \"dates-mdy-sort\"   | Sorts dates in US style mm/dd/yyyy format;. e.g (12/28/2023). Can use \"/\" or \"-\" as separator. Overides inferred \"dates-dmy-sort\" class.                                |\n| \"onload-sort\"      | Sort column on loading of the page. Simulates a click from the user. (can only sort onload for one column)                                                              |\n| \"disable-sort\"     | Disallow sorting the table by this specific column.                                                                                                                     |\n\n\u003cbr\u003e\n\n| \u0026lt;th\u0026gt; Inferred Classes. | Description                                                                                                                         |\n| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| \"numeric-sort\"               | Sorts numbers including decimals - Positive, Negative (in both minus and parenthesis representations).                              |\n|                              | Supports common currencies e.g ($£€¥) and percentage signs e.g (0.39%)                                                              |\n| \"dates-dmy-sort\"             | Sorts dates in dd/mm/yyyy format. e.g (18/10/1995). Can use \"/\" or \"-\" as separator.                                                |\n| \"dates-ymd-sort\"             | Sorts dates in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) yyyy/mm/dd format. e.g (2021/10/28). Use \"/\" or \"-\" as separator. |\n| \"file-size-sort\"             | Sorts file sizes(B-\u003eTiB) uses the binary prefix. (e.g 10 B, 100 KiB, 1 MiB); optional space between number and prefix.              |\n| \"runtime-sort\"               | Sorts runtime in hours minutes and seconds e.g (10h 1m 20s). Useful for sorting the GitHub actions Run time column...               |\n\n\u003cbr\u003e\n\n| \u0026lt;th\u0026gt; Classes that change defaults. | Description                                                                                                         |\n| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| \"order-by-desc\"                          | Order by descending on first click. (default is aescending)                                                         |\n| \"alpha-sort\"                             | Sort alphabetically (z11,z2); default is [natural sort](https://en.wikipedia.org/wiki/Natural_sort_order) (z2,z11). |\n| \"punct-sort\"                             | Sort punctuation; default ignores punctuation.                                                                      |\n\n## Development:\n\nIf you wish to contribute, install instructions can be found [here.](https://kyle-wannacott.github.io/table-sort-js/docs/development.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyle-wannacott%2Ftable-sort-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyle-wannacott%2Ftable-sort-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyle-wannacott%2Ftable-sort-js/lists"}