FANDOM


Line 1: Line 1:
 
You don't have to write any code, it's all already done by javascript included with wikia. You need to add "sortable" to the table class list, like this:
 
You don't have to write any code, it's all already done by javascript included with wikia. You need to add "sortable" to the table class list, like this:
   
<nowiki>{{{!}} class="wikitable sortable"</nowiki>
+
<nowiki>{| class="wikitable sortable"</nowiki>
   
 
then each column header needs a data-sort-type attribute, which is probably going to be "number".
 
then each column header needs a data-sort-type attribute, which is probably going to be "number".

Revision as of 00:46, December 1, 2018

You don't have to write any code, it's all already done by javascript included with wikia. You need to add "sortable" to the table class list, like this:

{| class="wikitable sortable"

then each column header needs a data-sort-type attribute, which is probably going to be "number".

{| class="wikitable sortable"<br/> ! data-sort-type="number" | A<br/> ! data-sort-type="number" | B<br/> ...rows...<br/> |}

http://community.wikia.com/wiki/Help:Sorting

Community content is available under CC-BY-SA unless otherwise noted.