开发者

Multi-sort Media Wiki Tables

I am trying to allow sorting a wiki table that use the "sortable" class by multiple columns.

Eg:

 {| class="wikitable sortable"
  |-
  |Col 1
  |Col 2
  |Col 3
  |-
  |3
  |开发者_Python百科a
  |tee
  |-
  |2
  |c
  |hot
  |-
  |5
  |b
  |apple
  |}

That will give you a basic sortable table on the wiki, but it won't let you sort by multiple columns.

Does anyone know of a way to do this or of an extension I can install that will allow me to do this?


Wiki sortable tables seem to already give the ability to multi-sort tables natively / without extension.

After clicking the first column to be sorted, press and hold shift key then click on other column headings for the next columns to be sorted. (Reference 1 2)

I am not sure this function is already there when this was asked, but this StackOverflow question seems to pop on search results more often than the article itself.


You can find any JavaScript code on the web for sortable tables and put that code in your user JavaScript or site Javascript. This simple one works because somebody has already added code for single column sortable tables which looks for tables of class "wikitable sortable".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜