Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sort all tables, everywhere.
// ==UserScript==
// @name TableSorter
// @author dertuxmalwieder
// @namespace tuxproject.de
// @description Makes all tables sortable.
// @include *
// @exclude /\.(jpe?g|png|gif)$/
// @require https://raw.githubusercontent.com/White-Tiger/sorttable.js/master/sorttable.js
// @require https://raw.githubusercontent.com/franciscop/umbrella/master/umbrella.min.js
// @version 1.1
// @license CDDL-1.0; https://spdx.org/licenses/CDDL-1.0.html#licenseText
// @downloadURL https://gist.githubusercontent.com/dertuxmalwieder/6f3c5fabaa089892d9ddc75c4e4fd9bc/raw/TableSorter.user.js
// @run-at document-idle
// ==/UserScript==
if (u("table.sortable").first() != null) {
// Assume there is no other sortable plugin here.
u("table").each(function() {
u(this).addClass("sortable");
});
}
sorttable.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment