Help:Sortable tables: Difference between revisions

Content deleted Content added
updated from m:Help:Sorting
Excluding the first row from sorting
Line 501:
!Name!!Surname!!Height
|}
 
==== 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 ===
Line 547 ⟶ 551:
If necessary one can apply sorting using a sortkey which [[Help:Cascading_style_sheets#Non-display|due to CSS is not displayed]]:
:<nowiki><span style="display:none">...</span></nowiki>
 
Example:
:<nowiki>p<span style="display:none">q</span>r</nowiki> gives p<span style="display:none">q</span>r
 
(However, on some projects, notably Ontoworld, a page with this wikitext cannot be saved, as spam protection.)
Line 1,068 ⟶ 1,075:
*[[Help:Table]]
*[http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/wikibits.js wikibits.js] - contains, among other things, the sorting code
**changes regarding sorting:
**for revision history see also [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/sorttable.js?view=log&pathrev=19698 sorttable.js]
***Nov 2007 [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=27138 allow multiple commas in numbers] - from [http://en.wikipedia.org/w/index.php?title=MediaWiki:Common.js&oldid=122738297]
***Feb 2007 [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/wikibits.js?r1=19987&r2=19989 allow pound and euro in currency sort mode]
***Jan 2007 [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=19699 sorttable.js merged into wikibits.js]
***for older revisions see the revision history seeof also [http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/sorttable.js?view=log&pathrev=19698 sorttable.js]
**{{mlm|MediaWiki:Common.js}} page overriding function ts_parseFloat(num) and function ts_resortTable(lnk) on Meta with improved versions
**{{mlw|MediaWiki:Common.js}} page overriding function ts_parseFloat(num)
**[[sv:MediaWiki:Common.js]] page overriding function ts_parseFloat(num); adaptation to decimal comma
*[[bugzilla:2001]] - resolved feature request