19,041
edits
(documenting autosorting tables) |
m (link fix) |
||
Line 34: | Line 34: | ||
*Next are an untested fix for table sorting and a tweak to the Upload page for unregistered users (does this do anything?). | *Next are an untested fix for table sorting and a tweak to the Upload page for unregistered users (does this do anything?). | ||
*Finally, there is code to allow the creation of tables that automatically sort themselves by a given column when the page is loaded. First, the table must be declared with the class "wikitable". Next, as part of the same class declaration, you must also add in "sortable" to enable the MediaWiki feature where each column has an arrow that can be clicked to sort that column. Now that you've declared both those classes, add the third class "autosort" to trigger the feature added by this code. By default, the table will be sorted by column 1, but you can specify another column by declaring a fourth class, "by-column-''x''", where 'x' is a number from 1 to 9. See [[BSL: | *Finally, there is code to allow the creation of tables that automatically sort themselves by a given column when the page is loaded. First, the table must be declared with the class "wikitable". Next, as part of the same class declaration, you must also add in "sortable" to enable the MediaWiki feature where each column has an arrow that can be clicked to sort that column. Now that you've declared both those classes, add the third class "autosort" to trigger the feature added by this code. By default, the table will be sorted by column 1, but you can specify another column by declaring a fourth class, "by-column-''x''", where 'x' is a number from 1 to 9. See [[BSL:List]] for a sample usage of this feature. | ||
[[Category:Policies and documentation]] | [[Category:Policies and documentation]] |