Help talk:Sortable tables

message: I observed a problem in instances of  which contain a custom caption. The template includes a series of sortable columns, so upon transclusion, any custom caption added after the template will follow the columns. On standard wikitables, there is no difference if the caption is listed before or after the columns in the table design. However, in sortable wikitables, the addition of a caption after the columns causes the sorting functionality to break and the column and row dividers are missing too.
Can the code for sortable wikitables be updated to handle for caption after the columns, disregarding them from the sort? SFB 20:48, 23 August 2023 (UTC)
replies: text: I would just follow the examples on Help:Table where the table caption is placed before the headers.  Jroberson108 (talk) 21:59, 23 August 2023 (UTC)

text: . Could you give examples using ? --Timeshifter (talk) 02:15, 24 August 2023 (UTC)
replies: text:  See previous example on Mo Farah here. This template contains parameters for defining both the table and the column, so users cannot apply a custom caption in wikitext when this template is used. I've found various cases, particularly with British athletes who naturally represent multiple nations, so I assume there are numerous instances of this in articles, but they are not easily identifiable without a manual search. I've updated the template to allow for multiple nations in the caption so the use case is covered and can be fixed by adding detail to the template parameters, but thought I'd raise this as the behaviour differs between sortable and regular wikitable. SFB 10:56, 24 August 2023 (UTC)
replies: text:  Sounds like this discussion should be moved to that template page. To clarify, what you are referring to is a table caption, which is not the same as headers in a table; otherwise it will get confusing. From the template and your recent edit, it displays a table caption of 1-2 flags/countries or, if doesn't have flag for the "nation" value, the text along with "Representing". As previously stated, the table caption has to be above all other rows including the column headers. I did a search for the code usage and found a lot where the table caption was moved to a "colspan" row of column headers, which doesn't mess up sorting. Search results. On the Christian Coleman page, there are two such tables like this: International competitions and National championships. Note that the "National championships" table doesn't show countries or flags. This improvised row of column headers would be more properly displayed as a table caption and would help with accessibility (screen readers), which is something that would need to be fixed on that template or those tables. A solution would be to add what they want displayed in the table caption along with any flags and links to the "nation" parameter, which would allow for multiple in one parameter. It would be better to discuss other solutions on that template page. Jroberson108 (talk) 22:01, 24 August 2023 (UTC)
replies: text:  Thanks for the correction! The nation parameter of that template already has a check so if something other than a nation is added (e.g. a team or club) then this will display in plain text. I'll have a think about how to best allow a "team" or "caption" option here... SFB 17:46, 25 August 2023 (UTC)
replies: text:  IMHO, I think users might be confused on the name of the parameter of "nation" ("caption" might have been better?), so doc clarity about its use in the table caption and recommended format ("the", which flag template, "&" for multiple, etc.) for consistency might help alleviate that issue. The "nation2" parameter could also be reverted if the doc is clear. This would also alleviate the need of adding additional parameters like "team" or "club" so it stays simple. Jroberson108 (talk) 18:48, 25 August 2023 (UTC)
replies: text:  The "nation" parameter has been there for nearly a decade and using it to show one national team accounts for 95%+ of usages. I've added the caption aspect this week purely because of this difference in table behaviour. It is very rarely used for non-national captions with this template. I'll add a caption parameter as an alt of nation and document that, as it already doubles for that usage anyway through the link check. SFB 20:37, 25 August 2023 (UTC)
replies: text:  I wasn't suggesting changing the "nation" parameter or the template logic around it, only documenting that it can be used for non-nations and even multiples where you would have to manually add any nation flags yourself. Adding a "caption" parameter would be clear, although the "nation" parameter also affects the table caption, so maybe specify they use one or the other. Might be good to discuss on that template's talk page with those involved? Jroberson108 (talk) 22:25, 25 August 2023 (UTC)

text: I just looked and saw you are the original creator of the template, so I guess discuss there if needed. Looks like you already added the "caption" parameter. Glad you found a solution. Jroberson108 (talk) 22:44, 25 August 2023 (UTC)

text: Thanks for including the context :) I've implemented support for two nations/captions in the affected template, plus inclusion of the team as column data rather than a caption. Alongside Jroberson108's other solution I think we've got enough functionality to handle all the use cases in some way! SFB 17:46, 25 August 2023 (UTC)
thread_title:  Caption bug? 

message: Can someone knowledgeable can lend a hand here, please: Talk:List_of_historical_earthquakes#Date_Ordering. Thanks! fgnievinski (talk) 00:44, 6 September 2023 (UTC)
replies: text: Fixed. Jroberson108 (talk) 01:50, 6 September 2023 (UTC)
thread_title:  List of historical earthquakes 

message: You are invited to join the discussion at Wikipedia:User scripts/Requests § Sortkeys in lists.   talk 15:40, 12 January 2024 (UTC)
thread_title: Discussion at [[:Wikipedia:User scripts/Requests#Sortkeys in lists|Wikipedia:User scripts/Requests §&nbsp;Sortkeys in lists]]

message: see Help:Sortable tables#Forcing a column to have a particular data type: data-sort-type=text uses alphabetical sorting of text, but numbers are sorted numerically within that alphabetical sorting.
Isn't there any possibility to get a column sorted strictly alphabetically instead of Natural sort order, so 0R11 before 0R9 ?
Many thanks, Aspiriniks (talk) 11:38, 17 April 2024 (UTC)
replies: text: You might want to ask at WP:VPT or WP:Phabricator. --Timeshifter (talk) 14:44, 18 April 2024 (UTC)

text: You'll need to adjust the cell's sort value to get the desired order. For "0R9", change it to | data-sort-value=0R90 | 0R9 to sort as: 0R11, 0R12, 0R9. A similar sort value would be needed for any other cell values that aren't four characters long. Jroberson108 (talk) 04:52, 19 April 2024 (UTC)
thread_title:  sorting strictly alphabetically - impossible? 

message: Hello, regarding List of cult films: K, it seems like the listings The Killer and The Killing, both which neighbor listings that have longer titles starting with Killer or Killing, wind up at the bottom of each respective group when sorting alphabetically, when they should come first, having nothing after that keyword. Am I doing something wrong? Is there a way to fix it? Erik (talk | contrib) (ping me) 14:24, 23 May 2024 (UTC)
replies: text: No idea. Maybe ask at  too. --Timeshifter (talk) 14:50, 23 May 2024 (UTC)
replies: text: I considered that, but it redirects to Template talk:Sort, which does not seem very active. Other suggestions for places to ask would be great. Erik (talk | contrib) (ping me) 14:52, 23 May 2024 (UTC)
replies: text: Maybe WP:VPT. --Timeshifter (talk) 15:47, 23 May 2024 (UTC)
thread_title:  Sorting titles, some with appended text