Eisspeedway

Help talk:Sortable tables: Difference between revisions

Content deleted Content added
Line 82: Line 82:
: try {{tl|dts}}. [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 13:12, 3 August 2016 (UTC)
: try {{tl|dts}}. [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 13:12, 3 August 2016 (UTC)
::Just on the ones with refs, or do all need to be changed?[[User:Naraht|Naraht]] ([[User talk:Naraht|talk]]) 14:42, 3 August 2016 (UTC)
::Just on the ones with refs, or do all need to be changed?[[User:Naraht|Naraht]] ([[User talk:Naraht|talk]]) 14:42, 3 August 2016 (UTC)
::: [[User:Naraht|Naraht]], if you use {{tl|dts}} you will probably need to change them all. if you just want to modify the rows with refs, you can try the method described in [[Help:Sorting#Specifying_a_sort_key_for_a_cell|specifying a sort key for a cell]]. unfortunately, that does require specifying the date twice. another method would be to put the reference in its own column, but that splits the ref from the information being referenced. you could try [[Help:Sorting#Forcing_a_column_to_have_a_particular_data_type|Forcing a column to have a particular data type]], but that really only works in limited situations. [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 18:13, 3 August 2016 (UTC)

Revision as of 18:13, 3 August 2016

WikiProject iconWikipedia Help NA‑class
WikiProject iconThis page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
NAThis page does not require a rating on the project's quality scale.

Numerical sorting question

I am currently working on this table. After reading the advice in this page, my understanding is that it is impossible to have the cells containing numbers sorted first, with blank/NA/- cells following afterwards. Is that correct? AtHomeIn神戸 (talk) 05:35, 23 July 2015 (UTC) Updated link since page has been moved. AtHomeIn神戸 (talk) 02:04, 2 September 2015 (UTC)[reply]

Accessibility issues when implementing "rank" in a separate table

The following note was left on my talk page, along with a revert of this version of a table:

List of countries by intentional homicide rate. Sorry to undo your edit. I know it was a lot of work. But I edit the Help:Sorting page, and understand the problems fairly well that can happen with row numbering. --Timeshifter (talk) 16:28, 27 July 2015 (UTC)

I replied as follows, but decided this topic merits a broader audience.

@Timeshifter: yes, that was a lot of work, most of which had absolutely nothing to do with row numbering. You said that "References in the chart break the row alignment between rank column and main table." I see your point, and accept that argument, but it's an incomplete argument. In fact, said alignment is already broken, and part of my reasoning for doing what I did was to fix the very problem of which you speak! Perhaps the real issue is the fragility of an implementation that uses a separate table to define a "rank" column. Frankly, from an accessibility perspective, I think that such separate-table implementations are a very bad idea that should be eliminated from Wikipedia. I apologize if those are your invention, but that's the truth.
Please remember that not everyone is using the same device and browser that you are using. Are you aware that for every user that has their browser set with a zoom any larger than 100% (which is a very large population of users), then "rank" columns are only meaningful on very narrow tables, such as the demo tables on Help:Sorting? In real life examples with wide tables, such as List of countries by intentional homicide rate, the rank column becomes meaningless drivel the instant any row changes height due to word wrapping. For example, zoom the page to 150%, and you will see that the final rank, 218, now aligns somewhere in the middle of the table!
By eliminating the needless "See notes below" column, it doesn't fix the problem entirely, but it narrows the table considerably, making the zoom less of an issue. Further, given the range of devices that may be used for display, articles are not supposed to be positionally "self-aware", using words like "shown below" or "on the right". There's a guideline about that somewhere, but I don't have the time to look for it right now. The use of {{efn}} and {{notelist}} templates is a simple (for both editor and reader), intuitive, officially-sanctioned, and meaningful way of presenting references and notes within a table. Sprinkling some notes at the top of the table, some at the bottom of the table, and some in a superfluous column on the side is certainly not sanctioned, nor is a separate rank column.
If you have any ideas to solve this issue, I'd love to hear it. I also suspect that we should elevate this conversation to a broader audience, like Help_talk:Sorting. In fact, don't bother replying on my page, I'll just copy/paste this over there now. grolltech(talk) 18:47, 27 July 2015 (UTC)[reply]
@Grolltech: What you say is true. And that is why there are some bug threads about it, one of which I started. See the thread links in the row numbering sections in Help:Sorting. Row numbering needs to become an integral part of tables via some class like class="wikitable sortable autonumber". In the meantime we are stuck with what we have.
On List of countries by intentional homicide rate I narrowed the notes column further. I also narrowed the years column further. So the row numbering now works at a narrower screen size than before. The table is now narrower than what you got it down to. When I am at 133% zoom the row numbering breaks down for me when I go below 1280 pixels wide. Without zoom I can go down to 1152 pixels wide.
One thing Wikipedia might do is to free up the right sidebar that shows up for some reason at some lower screen resolutions. I see now that using zoom causes the right sidebar to expand, and block table expansion. That might be something the MediaWiki developers might fix. I think it may have to do with complicated CSS, and sizes set in em units.
By the way, one part of your solution made things worse. The superscript (of the reference notes) breaks row numbering at all screen resolutions, and not just narrower ones. --Timeshifter (talk) 03:26, 28 July 2015 (UTC)[reply]
There are Phabricator threads asking for a table option for a fixed column, a static rank-order column, or row numbering. See phab:T42618. It supercedes phab:T42634. --Timeshifter (talk) 07:13, 15 August 2015 (UTC)[reply]
There is a working patch. I don't know what the holdup is with the patch being implemented. See phab:T42618. --Timeshifter (talk) 12:36, 5 December 2015 (UTC)[reply]

Update on wikitable caused several problems in sortable tables.

The new display of sortable buttons in column headers of a sortable table caused several good-looking tables to be ruined. Things noticed:

  • Table headers having a separate row for sorting now have their main headers also have these buttons. In addition to looking redundant, these main header buttons also take up the space that was intended to be used by the other columns.

(see its effects on table examples in: Help:Sorting#In a narrow space: sorting buttons in a separate row)

  • Nested tables (that are unsortable) also have these sorting buttons at their headers when they are nested inside a sortable table.
  • Even table 'footers' have these up-down sorting buttons.

It appears the solution I know of is at the moment is to painstakingly add class="unsortable" to all headers (and footers) so that these sorting buttons disappear. Is there a better/easier solution than this? Sanglahi86 (talk) 18:28, 5 February 2016 (UTC)[reply]

Looks like a bug that needs to be reported to Phabricator. I don't have time now. I don't know when I will get time. --Timeshifter (talk) 01:33, 8 February 2016 (UTC)[reply]

Splitting a long sortable table to display as two side-by-side sections

I am looking to make a sortable table which has a lot of rows (over 200) and instead of having it display as one long table, is there any method to have it display as two side-by-side "columns" on the page (similar to using {{colbegin}} to split lists into multiple columns) but still have it be a single sortable table? – Lestatdelc (talk) 04:48, 17 February 2016 (UTC)[reply]

Sort ascending/descending is backwards

Ascending sort means that the values get bigger as you go down, descending sort means the values get smaller as you go down. Currently this is reversed.[1]. — Preceding unsigned comment added by 143.48.49.193 (talk • contribs) 11:32, 4 March 2016‎

You link to Sorting#Sorting information or data. I think you are referring to the tooltip on the sort button? If so, I see that the tooltip label changes depending on whether clicking it will sort the column in ascending order or descending order. So if the column is currently in ascending order, then the tooltip says "Sort descending". --Timeshifter (talk) 19:04, 4 March 2016 (UTC)[reply]

References

  1. ^ "Sorting". Wikipedia. Retrieved 4 March 2016.

Handing refs on dates?

In List of Alpha Kappa Psi chapters there are a few dates that have references, so the entries in the table are like

January 5, 1900

January 6, 1900<ref>blah-blah</ref>

January 8, 1900

Any suggestions on how to handle this? Naraht (talk) 18:37, 5 July 2016‎ (UTC)[reply]

try {{dts}}. Frietjes (talk) 13:12, 3 August 2016 (UTC)[reply]
Just on the ones with refs, or do all need to be changed?Naraht (talk) 14:42, 3 August 2016 (UTC)[reply]
Naraht, if you use {{dts}} you will probably need to change them all. if you just want to modify the rows with refs, you can try the method described in specifying a sort key for a cell. unfortunately, that does require specifying the date twice. another method would be to put the reference in its own column, but that splits the ref from the information being referenced. you could try Forcing a column to have a particular data type, but that really only works in limited situations. Frietjes (talk) 18:13, 3 August 2016 (UTC)[reply]