Skip to content

Demonstration of table data sorting in vanilla JavaScript.

License

Notifications You must be signed in to change notification settings

Amarok24/table-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

table-sort

Demonstration of table data sorting in vanilla JavaScript.

  • No dependencies, vanilla JavaScript + HTML5.
  • It uses JavaScript modules so it won't work offline in a browser. Start a live-server or copy it directly to a server and open the index.htm file.
  • Click on table headers to sort (ascending/descending).
  • Click on any row of the table to instantly remove it from the list.

Online demo

https://amarok24.github.io/table-sort/src/


SCREENSHOT

see here

TROUBLESHOOTING

You may get one of those errors in the browser console and the script won't run:

Loading module from “xxxxx/modules/xxxxx.mjs” was blocked because of a disallowed MIME type (“”).

Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.

In such cases the server does not know the MIME type of JavaScript modules. A simple renaming to .js (instead of .mjs) won't help. If you are running an Apache server put this into your .htaccess file:

RewriteEngine on

AddType text/javascript js mjs