Content deleted Content added
m m |
|||
Line 6:
Note that all of the below is subject to change due to improvements in the script.
==
The JavaScript code [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/wikibits.js?view=log wikibits.js] has on each site a copy at
<nowiki>{{SERVER}}/skins-1.5/common/wikibits.js</nowiki>, on this site {{SERVER}}/skins-1.5/common/wikibits.js. In addition a site may have a page [[MediaWiki:Common.js]] which adds and overrides some code. The description below applies to the version on Meta, {{mlm|MediaWiki:Common.js}}. The sorting code in it can be copied to other sites (by sysops of these other sites). See also [http://meta.wikimedia.org/w/index.php?title=Help:Sorting&oldid=560222 the version of this page applicable without modifications of the JavaScript].
Line 486:
==== Issues ====
Please note that only one row can be marked with <code>class="sortbottom"</code>. Doing otherwise results in the marked rows being sorted with each other, which usually is not the intended behavior.
Line 503 ⟶ 502:
==== Excluding the first row from sorting ====
Hence, the first row of a table can be made non-sortable (the code <code><s>class="sorttop"</s></code> not being valid) by marking every other row except the first with <code>class="sortbottom"</code>. This first row can either be a normal visible row (to provide annotation for the headers) or a hidden row (with each element marked with <code><nowiki><span style="display:none">...</span></nowiki></code>) to insure that each column has the desired sort mode.
=== Making a column unsortable ===
If you want a specific column not to be sortable, specify <code>class="unsortable"</code> in the attributes of its header cell.
Line 567 ⟶ 564:
===Unsuitability of padding with no-break spaces===
The effect of left-padding with [[w:Non-breaking space|"&nbsp;" codes]], which render as blank spaces, depends on the browser: in IE they are (unlike actual blank spaces) counted for sorting as leading blank spaces, so in a list of numbers with text (for which the alphabetic sorting mode applies) they could be used to equalize the number of characters before the explicit or implicit decimal separator. However, in Firefox they are ignored for the purpose of sorting.
{|class="wikitable sortable"
Line 670 ⟶ 667:
==Dates==
{|
|-
Line 896 ⟶ 892:
==Static column==
A static column, e.g. with row numbers, can be obtained with two side-by-side tables with for each row the same height set in both tables:
{|
|-
|