Skip to content

sorttable.js file in this project repository can be used by anyone to sort their html tables dynamically. A complete working example html table file is also added now for learning and testing puposes.

Notifications You must be signed in to change notification settings

linuxguist/sorttable

Repository files navigation

sorttable

sorttable.js file in this project repository can be used by anyone to sort their html tables dynamically.

A complete working example of a html table file is also added now for learning and testing puposes here.

Screenshot of this example is given below.

** Instructions: **

  1. Download this repository by clicking on the Code Button above and choose "Download ZIP" option.
  2. Extract the ZIP file and then copy the sorttable.js file to your HTML Table file folder.
  3. Add the line: <script src="sorttable.js"></script> to your HTML Table file, in its head section.
  4. Add class="sortable" to any table tag definition, that you have, to make it sortable.
  5. Click on any table headings to see it sort dynamically.

For Point 3. above, Alternately, you can use the following script/src tag value given below, in the head section of your html file, for an online reference to this javascript file:

<script src="https://cdn.jsdelivr.net/gh/linuxguist/sorttable@main/sorttable.js"></script>

If you need further help, then view and edit the .html file present in this download ZIP file, both on the Internet Browser and on good Code/Text Editors like Sublime Text OR Kate OR Geany OR Notepad++ OR Programmer's Notepad, for the syntax used therein. Search for keywords used there quickly.

This javascript code written originally by Stuart Langridge has been enhanced by me, in two ways:

  1. Replaced the Down/Up arrow icons with nice looking unicode counterparts.
  2. The sort ascending and descending order icons are shown appropriately.

Thanks to Stuart Langridge and many others for contributing the original code.

I thank the following forum article for inspiring me to develop this project idea: https://www.sololearn.com/Discuss/2497295/how-to-host-my-js-files-online-for-private-use-yourjavascript-com-is-not-working

HTML Table With Features

About

sorttable.js file in this project repository can be used by anyone to sort their html tables dynamically. A complete working example html table file is also added now for learning and testing puposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published