Help talk:Sortable tables: Difference between revisions
Timeshifter (talk | contribs) →Not jumping in order: reply |
Timeshifter (talk | contribs) →Not jumping in order: more |
||
Line 156: | Line 156: | ||
|test2 |
|test2 |
||
|} [[User:Rafael Ronen|Rafael Ronen]] 01:31, 18 January 2025 (UTC) |
|} [[User:Rafael Ronen|Rafael Ronen]] 01:31, 18 January 2025 (UTC) |
||
:class=mw-sortable is not needed since class=sortable is there. |
|||
{| class="wikitable sortable mw-collapsible mw-collapsed" |
|||
|- |
|||
!A |
|||
!B |
|||
|- |
|||
|test |
|||
|test |
|||
|- |
|||
|test1 |
|||
|test1 |
|||
|- class=sortbottom |
|||
!colspan=2|CDE |
|||
|- class=sortbottom |
|||
|test2 |
|||
|test2 |
|||
|} |
|||
:Looking at the wikitext: |
:Looking at the wikitext: |
||
<syntaxhighlight lang=wikitext> |
<syntaxhighlight lang=wikitext> |
||
{| class="wikitable sortable mw-collapsible |
{| class="wikitable sortable mw-collapsible mw-collapsed" |
||
|- |
|- |
||
!A |
!A |
||
Line 176: | Line 195: | ||
|} |
|} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
--[[User:Timeshifter|'''Timeshifter''']] ([[User talk:Timeshifter|talk]]) 03:43, 18 January 2025 (UTC) |
|||
What do you want to use this for? Totally collapsed tables aren't allowed in articles except in the collapsed tables at the bottom of articles. --[[User:Timeshifter|'''Timeshifter''']] ([[User talk:Timeshifter|talk]]) 04:38, 18 January 2025 (UTC) |
Revision as of 04:38, 18 January 2025
![]() | This help page does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||
|
Sort under template
![](https://upload.wikimedia.org/wikipedia/en/thumb/f/fb/Yes_check.svg/20px-Yes_check.svg.png)
I created the {{sort under}} template to reposition the sorting arrows under the text without the issues that come with adding sorting buttons in a separate row. Please review and mention any issues on its talk page. Jroberson108 (talk) 20:25, 28 January 2024 (UTC)
Comments are requested there specifically concerning whether the default class=sort-under should be centered sorting icons or right-aligned sorting icons. Or even left-aligned ones. --Timeshifter (talk) 21:46, 28 January 2024 (UTC)
- For those who are interested. Someone at the technical Village Pump suggested going to this MOS discussion page since it is a style discussion, and not a technical problem. See:
- Wikipedia talk:Manual of Style/Tables#Template:Sort under
- --Timeshifter (talk) 14:11, 4 February 2024 (UTC)
sorting strictly alphabetically - impossible?
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)
P.S. I see there was a related discussion one year ago at Help_talk:Sortable_tables/Archive_4#data-sort-type=text_doesn't_seem_to_work_properly - any news since then? -- Aspiriniks (talk) 11:56, 17 April 2024 (UTC)
- @Aspiriniks: You might want to ask at WP:VPT or WP:Phabricator. --Timeshifter (talk) 14:44, 18 April 2024 (UTC)
- @Aspiriniks: 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)
Sorting titles, some with appended text
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)
I guess I fixed it by adding two spaces after each title, but this feels like too much of a hack. Is there a proper way to do this? Erik (talk | contrib) (ping me) 14:26, 23 May 2024 (UTC)
- No idea. Maybe ask at {{sortname}} too. --Timeshifter (talk) 14:50, 23 May 2024 (UTC)
- 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)
- Maybe WP:VPT. --Timeshifter (talk) 15:47, 23 May 2024 (UTC)
- 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)
Sorting rowspan groups with sortbottom
Sorting the following table with class=sortbottom for the bottom 2 rows removes the blank rows, displaying thusly. Qwerty284651 (talk) 21:13, 1 July 2024 (UTC)
- The rowspan number was wrong. I temporarily added {{static row numbers}} to see that. Also, I added dashes in the blank spots in the bottom 2 rows. Both changes were needed to fix the problem. See diff.
- An easier solution is to eliminate the blank columns. And list those years above the table. It would also make the table narrower. --Timeshifter (talk) 06:53, 2 July 2024 (UTC)
- Yeah, that's the alternative I had with removing the years and adding a note above the table about the skipped years. Btw, why does static row display blank without bgcolor? Qwerty284651 (talk) 12:56, 2 July 2024 (UTC)
Template:Year in date-sorted table
I just created Template:Year in date-sorted table as the inverse of Template:Date table sorting. I welcome input if there are better solutions to achieve the same goal, additional features that would be useful, and or suggestions for a more descriptive template name. Daask (talk) 20:24, 16 July 2024 (UTC)
- You might get more discussion at Help talk:Table or WP:VPT. I am not really into this now. --Timeshifter (talk) 00:27, 18 July 2024 (UTC)
Sort bottom other than one column
Looking at List of National Women's Soccer League seasons, the table uses "sortbottom" such that if you sort on any column other than "season", the season which was wiped out by COVID goes to the bottom. But this means it's then impossible to re-sort the "season" column into the correct order, so I was wondering if the "sortbottom" could be dispensed with and instead a sortkey put on the block of text which spans all bar the first column in the 2020 row. If "ZZZZ" is used, it sorts at the bottom for the alphabetical columns but at the top for the numerical columns. If "999999" is used, it sorts at the bottom in the numerical columns but top in the alphabetical ones. Is there any value that would sort at the bottom in both types of column.......? ChrisTheDude (talk) 08:47, 10 January 2025 (UTC)
- I did some edits. I removed class=sortbottom. It causes more problems that it solves.
- Here is the sticky table version before I removed class=sortbottom:
- https://en.wikipedia.org/w/index.php?title=List_of_National_Women%27s_Soccer_League_seasons&oldid=1268590131
- In case others want to do further experimentation.
- --Timeshifter (talk) 14:52, 10 January 2025 (UTC)
- @ChrisTheDude: See if you can find anything here:
- Help:Sortable tables#Alphabetic sorting order
- Help:Sortable tables#Numerical sorting order examples
- By the way, why did you remove the sticky table formatting? It is greatly needed on a wide table like that since I made the left column sticky too. Very useful for cell phones. You could have just returned the class=sortbottom without removing the sticky table formatting. That way you can still run tests with class=sortbottom. --Timeshifter (talk) 18:44, 17 January 2025 (UTC)
Not jumping in order
how to make CDE and test2 not jump in order (wikitable sortable)
A | B |
---|---|
test | test |
test1 | test1 |
CDE | |
test2 | test2 |
— RAFAEL RONEN 13:42, 17 January 2025 (UTC)
- @Rafael Ronen: I am not sure that is possible for the CDE row by itself. Unless you start it off at the top or bottom, and then use class=sorttop or class=sortbottom.
- You can make both CDE and test2 rows use class=sortbottom since they start off as consecutive rows on the bottom.
- By the way, your signature color and text size is not very accessible. It is very hard to read for me.
A | B |
---|---|
test | test |
test1 | test1 |
CDE | |
test2 | test2 |
{| class="wikitable sortable"
|-
!A
!B
|-
|test
|test
|-
|test1
|test1
|- class=sortbottom
!colspan=2|CDE
|- class=sortbottom
|test2
|test2
|}
--Timeshifter (talk) 18:37, 17 January 2025 (UTC)
- @Timeshifter if we use mw-collapsible mw-sortable mw-collapsed, press "show" then press order 🔼🔽 then press "hide", so sortbottom is shown
A | B |
---|---|
test | test |
test1 | test1 |
CDE | |
test2 | test2 |
Rafael Ronen 01:31, 18 January 2025 (UTC)
- class=mw-sortable is not needed since class=sortable is there.
A | B |
---|---|
test | test |
test1 | test1 |
CDE | |
test2 | test2 |
- Looking at the wikitext:
{| class="wikitable sortable mw-collapsible mw-collapsed"
|-
!A
!B
|-
|test
|test
|-
|test1
|test1
|- class=sortbottom
!colspan=2|CDE
|- class=sortbottom
|test2
|test2
|}
What do you want to use this for? Totally collapsed tables aren't allowed in articles except in the collapsed tables at the bottom of articles. --Timeshifter (talk) 04:38, 18 January 2025 (UTC)