Template:Medals table is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.
This template is within the scope of WikiProject Sports, a collaborative effort to improve the coverage of sport-related topics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.SportsWikipedia:WikiProject SportsTemplate:WikiProject Sportssports
Assess : newly added and existing articles, maybe nominate some good B-class articles for GA; independently assess some as A-class, regardless of GA status.
This template is within the scope of WikiProject Olympics, a collaborative effort to improve the coverage of Olympics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.OlympicsWikipedia:WikiProject OlympicsTemplate:WikiProject OlympicsOlympics
@Zackmann08: Cool! I didn't expect the column would be merged if the NOC has the same rank. My suggestion is, since the ranks are automatically generated based on medal, maybe better to use IOC codes to distinguish the parameter instead of number (example goldCHN, thus we don't need nation1). Sometimes in the main article we only display top 10 NOC + "Remaining NOCs" by transclusion (see 2016 Summer Olympics#Medal table, sometimes not, see 2018 Winter Olympics#Medal table) is this template able to do this? Also NOCs total number needs to be displayed in the bottom of the table. Hddty. (talk) 02:33, 18 September 2018 (UTC)[reply]
@Hddty.: how does this look? Test it out and let me know if you have any thoughts or feedback. I would LOVE your assistance with improving the documentation. If anything is unclear please let me know.
@Hddty.: ok so I made it happen! Here's how it will work... You create a template that is the table. (See Template:Medals table/testcases-show-limit). This template takes 1 or 2 params. The show limit and the link for "remaining". Then anywhere you want that table to appear, you just call the template. So as an example:
I have a question. The current situation with Russion doping cases caused IAAF to exclude Russian federation, so Russian athletes participate as Neutrals, the sportpeople can win medals but they are not included (or not ranked) in the medal tables. Example European_Athletics_Championships#All-time_medal_table - is it possible to achieve smth like that with this template? --Pelmeen10 (talk) 21:54, 19 September 2018 (UTC)[reply]
@Pelmeen10: so technologically speaking, sure that could be done. I'd just need to add a param similar to {{{no_rank_ANA}}} that if set would cause that nation/entity to be skipped in the rankings... But honestly seems kinda weird to have them in the table but no included in the rankings. An edge case to be sure. --Zackmann08 (Talk to me/What I been doing) 22:15, 19 September 2018 (UTC)[reply]
@Zackmann08: Last request, make the host's country color like above because coloring the whole row is excessive. Also the number of gold, silver, bronze and total in "Remaining NOCs" shouldn't be italicized. Thanks. Hddty. (talk) 23:43, 19 September 2018 (UTC)[reply]
Zackmann08 and Hddty.: (1) I moved the host note to the top of the table, but added the option to move it to the bottom with |legend_position=b (we can make the default bottom if this is better). (2) if you use |host=KOR it will expand this into 'Host nation (South Korea)' for you. (3) I added an optional |host_note= for a footnote after this text. (3) I added |note_XYZ= to add a footnote for XYZ nation. (4) I added optional |source= and |notes= for source or notes at the foot of the table. we could probably make it so that |host=KOR also toggles |host_KOR=y, or the other way around. is there anything else that is missing? Frietjes (talk) 13:28, 20 September 2018 (UTC)[reply]
Hi, is that possible to give it an option to set the width of the second column (NOC) manually ? I just think something like this looks a bit ugly, other columns have more width than the country name. I mean we have fixed width for other columns. Mohsen1248 (talk) 23:36, 20 September 2018 (UTC)[reply]
Well if you ask me the thing was simple with the medal table. and they are now complicated. (even though I'm fine with both, no big deal) my point wasn't about having one country. (I edited my example to show you my point) but since "China" is a short name, the table looks ugly "to me" the nation column needs a bit more width than other columns in my opinion. speaking of complication, while this idea works for multisport events. what are you going to do with flag variants ? I see you edited 2000 World Karate Championships but you should know that wasn't Yugoslavia who win that medal but Yugoslavia and they are very different. the current template doesn't give me any option to fix that. (or at least I'm not aware if there is)
or this one 1910 World Weightlifting Championships only in this case both countries in the medal used exactly the same parameters for the flag, so your templates work here but what about other competitions with different flag parameters ? another thing in case of tie, the template sorts countries based on IOC Code and not their name (for example India stands above Chinese Taipei or Thailand above Tajikistan) , don't you think you should fix these problems (specially flag variants) before editing hundreds of pages ? Mohsen1248 (talk) 03:06, 21 September 2018 (UTC)[reply]
so this is it ? you don't like it and because of that you are not going to give other options ? apparently this is how things work in wikipedia recently. OK , but I still can't understand how we have "fixed" width for 3rd, 4th, 5th and 6th columns and only not for the 2nd column !
OK, that {{{name_IOC}}} solves the flag variant issue but still my concern remains about the sorting countries based on NOC code and NOT alphabet (as I gave two examples). beside that you should be more careful with your edits. looks like I have to double check most of those pages for possible mistakes. for example 2015 World Weightlifting Championships you deleted one of those two medal tables considering it "duplicate". in this specific sport there are two medal tables at the end of the competition. Mohsen1248 (talk) 21:40, 21 September 2018 (UTC)[reply]
@Mohsen1248: if you feel the need to check all my edits, knock yourself out! I have checked and when you click on the top of the column, the sorting is based on the name that is displayed, not the IOC code. If you are seeing something different, please show me where and I will take a look. But currently I cannot reproduce your issue. --Zackmann08 (Talk to me/What I been doing) 21:57, 21 September 2018 (UTC)[reply]
@Zackmann08: I also agree that, by default, the table should sorting the countries that have the same rank based on alphabet because the text is placed on the left (read first). Hddty. (talk) 06:38, 22 September 2018 (UTC)[reply]
@Zackmann08: of course I'm going to check all pages in my watchlist (which is a big list) but when you finish it, beacuse I don't want to check them more than once. I checked few pages and there were mistakes in half of them at least. looks like you don't care about flag variants but some people do. For example here 1996 World Weightlifting Championships you used that parameter 1984 which solves it only for South Korea but we also have different flag for Japan. this is just an example there are several pages with the same problem. You say the sorting is based on IOC code, but what about this ? Mohsen1248 (talk) 09:56, 23 September 2018 (UTC)[reply]
Hi, can you simplify the show_limit parameter from | show_limit = {{{show_limit|<includeonly>10</includeonly>}}} to | show_limit = 10. Also maybe we need a parameter to display/not display "Remaining NOCs*. Thanks. Hddty. (talk) 21:33, 20 September 2018 (UTC)[reply]
I think a test case showing how to make the note and that it works is valuable. If something happens in the sandbox that breaks the note, that breakage will show up on the testcases page. Edge cases like this one are valuable to keep on testcases pages. – Jonesey95 (talk) 04:41, 22 September 2018 (UTC)[reply]
@Jonesey95: I should clarify, right now the test cases compare the old template ({{RankedMedalTable}}) to the new template/module. I'm still working out the kinks. Once we get things up and running consistently, then the test cases should be refactored so that they test the main template against the sandbox. You make a VERY good point! Thanks again. --Zackmann08 (Talk to me/What I been doing) 04:45, 22 September 2018 (UTC)[reply]
it looks like the skip feature is working. basically, you have to reset the "last" parameters to make sure it doesn't try to rowspan it incorrectly. the only thing that I didn't test is if there are two consecutive skips, or a skip between two that should have the same rank. for the case that you have a skip between two with the same rank, we would just need to adjust the sort algorithm to include skips. Frietjes (talk) 13:18, 22 September 2018 (UTC)[reply]
Looks much better than the old one. Nice work. One nitpick: I would lower-case "nations" in the Totals cell, per MOS. While doing that, you'll have to make sure you don't lower-case the top header, though, which looks like it is re-used at the bottom. But you know that. I don't know Lua well enough to make the change. – Jonesey95 (talk) 04:28, 22 September 2018 (UTC)[reply]
Would someone please fix the changes to use this template at the following. They are currently showing messages like "Lua error in Module:Country_alias at line 1778: Invalid country alias: PIC".
@Pelmeen10: seriously you're killing me smalls!!! (Said 100% in jest) Another great catch. Do you understand why it is happening? Basically it is skipping the `mixed` team in the numbers. If you look at the main table you will see the numbers are correct. Should be an easy fix... let me take a look. --Zackmann (Talk to me/What I been doing) 20:52, 23 September 2018 (UTC)[reply]
@Zackmann08: should be alphabetical order? And the way how host is displayed, should be somewhat similar in every case, but sometimes it includes wikilink, sometimes it even includes flag... --Pelmeen10 (talk) 14:48, 26 September 2018 (UTC)[reply]
I strongly recommend supporting only one list of official country codes, if possible. See the section immediately above for the problems that can happen when there are multiple lists of country codes. In the documentation, make it extremely clear which list is supported. – Jonesey95 (talk) 19:58, 24 September 2018 (UTC)[reply]
my feeling is that everything is passed through the specified (or implicitly specified) flag template. so, if the flag templates are allowing for different country codes, that's a problem that should be addressed in the flag templates. however, I don't see any problem with moving toward a single set of official country codes for consistency between articles. Frietjes (talk) 20:07, 24 September 2018 (UTC)[reply]
See the section above. At some point, the documentation should say what will happen when someone uses ANT or BRN as a country code. A choice needs to be made and documented by the designer of the template. – Jonesey95 (talk) 03:34, 25 September 2018 (UTC)[reply]
We can't accept 169/168 as a value for {{{gold_USA}}} because it won't compute with the math for finding the totals. In theory we could add a {{{gold_USA_display}}} or similar that would override the mathematical value and display a custom value, but I feel like if we start doing things like that it (A) Makes this WAY more complicated than it should be and (B) kind of defeats the purpose of the template to begin with. My feeling is that if you have a table like this, then you should really just create a custom table. Thoughts? --Zackmann (Talk to me/What I been doing) 18:43, 27 September 2018 (UTC)[reply]
I would pick the source that seems most trustworthy (or find a new, better one), use the numbers from that source, and preserve the notes explaining the possible discrepancies. – Jonesey95 (talk) 18:54, 27 September 2018 (UTC)[reply]
But that is obviously ugly as heck.... So I'm looking for suggestions. For 99% of the tables, just doing gold_<IOC> or silver_<3-letter-code> works fine. But for cases where a 3 letter code is not applicable, do we want to allow for other options? One thought I had was that we could also allow {{{gold_#}}}, i.e. {{{gold_1}}}, {{{gold_2}}}, {{{gold_3}}}, etc... Obviously {{{gold_1}}} would match up with {{{silver_1}}}, {{{bronze_1}}}, {{{name_1}}} etc. One thing that would we would have to do is that if you use a numbered param (instead of 3 letter codes) you MUST provide a display name.
My concern is that this is starting to get a bit complicated. I'm all for making templates work for as many cases as possible, but I wonder whether this might be a case where there should just be a second template? Frietjes you're the absolute expert here so I'll defer to you on the technical side of things, though I am more than happy to do the coding myself. --Zackmann (Talk to me/What I been doing) 00:34, 2 October 2018 (UTC)[reply]
I'm lazy, so I would do the 99% first and then look at the edge cases that are left to see if there is a way to address them together. – Jonesey95 (talk) 04:16, 2 October 2018 (UTC)[reply]
It looks weird to me that the athletes' name is sandwiched between the flag and the IOC code. Maybe it edited that way because {{RankedMedalTable}} don't have another column.
You could also add optional columns with labels, so that |extra_column_header=Athlete and |extra_column_1=Name of first athlete, or something like that. That would allow for a label like "Sport" or "Athlete", populated by items of the editor's choice. – Jonesey95 (talk) 10:16, 2 October 2018 (UTC)[reply]
I like the 2nd table above with a separate column for Athlete and Nation.. That being said, I think this template is going to get too confusing. Not just in terms of complicated module code, but in terms of implementations... My vote at this point would be to create a {{athlete medals table}} or something of that nature... But that doesn't solve the initial problem of Sports instead of country tables... SO basically there seem to be 2 issues:
1) How do we handle the case where instead of rows representing nations, the rows represent a sport, club or some other entity that cannot accurately be represented by a 3 letter code.
2) How do we handle the case where the rows are for athletes, many of whom may be from the same country and thus cannot use the 3 letter country code as there would be duplication.
About the first example - it's also a bit funny one, because it's top10 most successful athletes usually, so "totals" row is quite pointless there i think. --Pelmeen10 (talk) 18:29, 2 October 2018 (UTC)[reply]
(edit conflict) @Pelmeen10: Top be clear, that is how the table was to begin with... I just converted it over to use the new template. It had the rank already. You're point isn't without merit, but I just want to be clear that it isn't like the rank was suddenly added. Personally, I think the rank IS useful and not the least bit confusing. It shows which sports that team/country have gained the most medals in. Additionally, since I've converted nearly every single transclusion of the template, I can tell you that this absolutely isn't the only case like this. I've seen dozens of them.
Continuing from above but under a new heading... @Pelmeen10: I'm more than happy to add {{{hide_totals}}}. Will only take me a minute or 2... But this might be a great opportunity for you to learn some Module stuff if you are interested? If you'd rather not no worries! Everyone has different interests with editing wikipedia so like I said, I'm happy to do it myself, but if you want to give it a try I added a new testcase already and you can experiment with Module:Medals table/sandbox. At the bottom you will see Preview page with this module. If you drop Template:Medals table/testcases into that field you can preview the results as you go. Let me know if you want to try it out and I'm happy to help. Otherwise, as I said, I'm happy to do it myself. :-) --Zackmann (Talk to me/What I been doing) 18:38, 2 October 2018 (UTC)[reply]
The medal tables usually contain plain country names. "Flagteam" add 3 letter code in parenthesis which is not necessary in most cases. Many sports don't have any codes for countries and many sports are not connected to the Olympics (IOC codes). --Pelmeen10 (talk) 18:39, 2 October 2018 (UTC)[reply]
@Pelmeen10: thanks for discussing here. I'd like to get input from @Jonesey95, Hddty., and Frietjes: and any others watching this... But it takes about 5 seconds to change the default parameter in the Module. I want to avoid having a default in the documentation like you did. It is better to just have a default in the module that can be over-ridden. TBH I actually agree with you. Initially this was designed with the focus on the Olympics which always has 3 letter codes... But most other sporting events do not, so unless one of the others raises something I haven't thought of, I think making the default flagcountry is a good call. Lets give it a day or 2? Without objection I will then change it. :-) --Zackmann (Talk to me/What I been doing) 18:45, 2 October 2018 (UTC)[reply]
Was it intentional to change the host nation shading so that just the NOC cell is now highlighted and not the whole row? Or was it just something that got accidentally altered in the translation? Personally I preferred it when the whole row was highlighted so that you could see at a glance how many medals the host nation won. It's only my personal opinion but I thought the idea was to translate the tables seamlessly so that no-one would notice the difference. Rodney Baggins (talk) 13:34, 3 October 2018 (UTC)[reply]
@Rodney Baggins: you are correct that the idea was to translate the tables seamlessly. I'd like @Frietjes: to chime in here since she was the one to make that specific change but I think the situation below illustrates one reason that this was done. I.E. the rank being colored for both Cuba and USA when USA was the host. That being said... we could add the color to everything except for the rank? I'm certainly open to any ideas. Thanks for bringing this point up. Do know that if the decision is made to color the whole row instead of just the 1 cell, that change can easily be made in the module and will automatically be reflected on all the pages. --Zackmann (Talk to me/What I been doing) 16:38, 3 October 2018 (UTC)[reply]
I noticed a little while ago that the table formatting in a medal table list I have on my watchlist was converted into the output from this template. That article is a featured list, and most of the formatting looks up to that standard. However, I'm not sure that tables formatted with this template meet the accessibility guidelines that featured lists should follow. The problem is it doesn't look like the tables include row and column scopes for web browsing tools like screen readers, as described here. As the featured list director, and primary contributor to that list I mentioned earlier, it would be quite unfortunate if using the seemingly nice-looking formatting from this template actually caused lists to not meet the FL criteria, so I'd like to request that support for scopes be added if at all possible. If it helps, I saw a comment at the merge discussion for Template:Medal table which indicates support for at least the column scopes exists in that template. If some formatting could be copied from that template to provide scope support here, that would be fantastic. Giants2008 (Talk) 15:17, 14 October 2018 (UTC)[reply]
Hi, I notice that the Lua code relies upon the existence of a "gold" field in order to produce an output row for an IOC. Can this be modified to pickup any of gold, silver, or bronze? This will allow us to omit needless zero medal inputs. Thanks SFB12:35, 9 June 2019 (UTC)[reply]
Is it possible to give an option to add extra columns with arbitrary content? It would be usefull to be able to use this template for "Medals by Summer Games" and "Medals by Winter Games" tables in numerous "Country at the Olympics" articles. For example Austria at the Olympics. Almost all of these tables have additional columns "Athletes" and "Rank", which cannot be displayed using Medals table template. Nitobus (talk) 11:15, 7 June 2020 (UTC)[reply]
Not done (as to the immediate edit request). Please make your changes in the sandboxes and verify test cases before activating the edit request. Feel free to continue discussing this below in the event someone else would like to work on it. — xaosfluxTalk15:33, 30 July 2021 (UTC)[reply]
To editor Hddty: yes, this can be done just by changing the color hexcode on line #31 from "#f8f9fa" to "#ffffff" and adding css to line 90. See my sandox. I'm just not sure it should be done. In my mobile view the cell in countries color is a very light gray. Does this cause WP:accessibility problems that I can't see? P.I. Ellsworth , ed.put'r there17:12, 17 August 2022 (UTC)[reply]
Not done (as to the immediate edit request). Please make your changes in the sandboxes and verify test cases before activating the edit request. Feel free to continue discussing this below in the event someone else would like to work on it. — xaosfluxTalk15:33, 30 July 2021 (UTC)[reply]
This template should have the option to bold out say the most medals. Not always the most medals overall is the nation with most gold medals, so it would be nice to bold out those most total, most bronze, most silver, most gold results. 188.27.36.191 (talk) 13:40, 4 August 2021 (UTC)[reply]
Is there a way to add a comma in the "Totals" row, when the total value exceeds 999? In other words, starting with the number one-thousand? I think it should appear as 1,000 (with a comma), not as 1000 (without a comma). I was directed to this Talk Page, with my question. I was told that a comma was "optional" with a four-digit number. But ... I think that most people would use/expect a comma, when there are four digits. Plus, it's easier to read (in my opinion). Thanks. Joseph A. Spadaro (talk) 19:07, 9 August 2021 (UTC)[reply]
+1 This template should absolutely be adjusted to include commas. Four-digit numbers without commas look like years. Brad (talk) 23:38, 11 August 2021 (UTC)[reply]
Not done: you are correct from the viewpoint of the US, the UK and China. In most of Europe it is reversed, so in the US the number 1,436.37 in most of Europe becomes 1.436,37. The practice of using a space to separate the 1000s is also common, as in 1 436,37 or 1 436.37 (both forms are common). Use of a comma to separate 1000s in Wikipedia articles is non-neutral from the global perspective. Exceptions occur of course, such as when an article is written in British English, which would use the UK form of large-number separators. Articles written in other forms of English might use a different form of separators. Where templates that are used in different kinds of English articles are concerned, the norm is to use no separators (for integers greater than 999). P.I. Ellsworth , ed.put'r there12:51, 16 August 2022 (UTC)[reply]
Hello, this is not the policy mentioned in the Wikipedia Manual of Style -- see MOS:DIGITS. User opinion would seem to be what matters within those confines, and I also think commas should be implemented. Brad (talk) 00:24, 12 August 2024 (UTC)[reply]
A comma would be correct, not a full stop after the first number. This requires applying something like the "formatnum" magic word to the totals. I don't know how to do that in Lua, but I'm sure someone around here does. – Jonesey95 (talk) 20:51, 12 August 2024 (UTC)[reply]
Hi there, I am building a medal table for a series of karate competitions.1 According to the rules of these competitions, the fourth to eighth places also have points. How can I create a table that includes fourth and subsequent positions? IWRUAH (talk) 11:53, 20 October 2021 (UTC)[reply]
The country for the IOC abbreviation "ROC" displays incorrectly. Each NOC should display the actually name of the NOC, followed by its IOC abbreviation, e.g., "Norway (NOR). In the case of the Russian Olympic Committee, it displays the abbreviation twice "ROC (ROC). It should display "Russian Olympic Committee (ROC). Or it should display "Russian OC (ROC), if the full name is too long for tables.
Please edit the appropriate template to implement this change. Thank you.
IOC = International Olympic Committee; NOC = National Olympic Committee;
ROC=Republic of China, Taiwan (when used as country abbreviation) or Russian Olympic Committee (when used a IOC abbreviation Sparkie82 (t•c)02:10, 22 February 2022 (UTC)[reply]
Macedonia only changed it's name a few years ago. Can there be an additional code, to render the name "Macedonia" for events before 2019, but point the link to North Macedonia? Or if it needs a separate target, point it to Macedonia (country). skakEL12:01, 2 May 2022 (UTC)[reply]
In theory, yes, and in theory it should be as easy as adding , year to the args call in the various frame:expandTemplate{title = flagTemplate, args = {IOC, event} } lines, but in practice I haven't used this module enough to know for sure; I would need to sandbox a few things first. I'll put this on my list, but it's rather low-priority at the moment so any other watchers are free to start working on it. Primefac (talk) 10:49, 4 May 2022 (UTC)[reply]
skakkle, just to circle back around to this, do you have any specific examples of where this is happening? I'm having trouble narrowing it down to where the wrong name is placed. Primefac (talk) 10:25, 8 August 2022 (UTC)[reply]
Is it possible to find all medal tables with MKD usage? I'd guess there isnt too many of them to just add |name_MKD=Macedonia in them. Links to {{MKD}} should be OK already. Pelmeen10 (talk) 06:21, 3 August 2022 (UTC)[reply]
Could there be an additional option in which, for example, the first 30 rows are visible and the rest are collapsed but expandable.
All-time Olympic:Complete ranked medals is very long with 154 entries, but it also shouldn't be shortened with the "show_limit" to summarize remaining entries. Miria~01 (talk) 12:57, 9 September 2023 (UTC)[reply]
To state the number of countries as a number of entries is simply false. To take the example of the 2022 European Cross Country Championships, the table states that there were 10 entries: that is wrong. There were 40 nations taking part.The current presentation suggests that no team at the event did more poorly than Belgium and Finland, while the truth is that 30 national federations looked jealously at the results that they had. This number adds no meaningful information (a glance at the final number in the ranking competition will satisfy the interest of anyone who could be interested in such an esoteric piece of data), and serves only to mislead.
If only ten teams win medals, then only ten teams are listed on the medal table. Thus, there are ten entries in the table. I'm not sure why this is an issue. For a larger table like the 2020 Olympics it is rather useful to know how many countries earned medals when the table is that long. Primefac (talk) 13:19, 1 December 2023 (UTC)[reply]
No: there were 206 nations that entered the 2020 Summer Olympics. Nobody considers the scope of an event by entries on the medal table rather than nations entering the tournament. That is what describes the depth of competition and to what extent it is an acheivement to attain even one medal.
It requires a very quick count of the teams that are joint last in the table to see how many teams appear there: that argument for the misleading claim might have some relevance if there were no rankings table. I really doubt that the number of nations gaining a medal in an historic games is really a piece of data that many people seek out: if there were demand for it, one suspects that someone would have seen fit to include a column here. And if it is not considered worth collating for the Summer Olympics, where is it a matter of interest? Google searches suggest that it is not.
Is there any evidence that it is considered worthy of recording in Reliable Sources? Looking at 2016 games, Inside the Games,ESPN and CBS Sports (the first three non-wiki results on a Google search) all give full lists without a total. Or is it just WP:Synth because someone noticed that we can? Kevin McE (talk) 11:34, 5 December 2023 (UTC)[reply]
I switched the template to use Module:Flagg instead of {{flagteam}} or {{flagcountry}}, which should reduce the WP:PEIS on larger pages. I also added a few tweaks to improve the display of certain flags and better detect when historical flags should be used. All the testcases looked good after this change, but let me know if you come across any unintended consequences. --Ahecht (TALK PAGE) 18:55, 18 April 2024 (UTC)[reply]
Many tables transcluding this template are getting longer. As I think, sticky headers are needed, especially for readability. George Ho (talk) 05:32, 6 August 2024 (UTC)[reply]
It can be useful if we could filter the table according to content. In case of regional competitions like Asian Games, we can either avoid using this parameter or just add sub regions. Footy2000♡; 06:09, 6 August 2024 (UTC)[reply]
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
Description of suggested change:
I would like to update this template's module with the current revision of the sandbox (diff). I have added a functioning dark mode for the Vector 2022 skin and fixed the table header's and footer's colours so they match other tables on Wikipedia.
I like the proposed version which works both under light and dark mode. The background color changes from white to grey in the light mode, so there is a small difference for the test cases. Is this intentional? But all in all I think the proposed change is a clear improvement.--Kallichore (talk) 21:21, 8 August 2024 (UTC)[reply]
Hi Kallichore, I'm glad you like the proposed changes. And yes, the light mode table's background colour change is intentional; on Wikipedia pages with tables such as Canada at the Olympics, all of the tables on that page except for the ones using this template have a specific shade of grey as their background. I have updated this template to use that shade of grey on light mode. PitConclave (talk) 21:39, 8 August 2024 (UTC)[reply]
Current sorting option does its job, but fails when it comes to the rank column. For example, with the defeault table sorted according to gold medals, you have:
But see what happens after clicking sort option for the Total table. There is no change in the Rank and France maintains 4th Rank while it is 3rd in the table. The static row numbers if implemented approprietly could solve this and make sorting useful.
Footy2000♡; 08:31, 9 August 2024 (UTC)[reply]
Sorry but I can't see any issue with the sorting on the rank column. It all seems to behave properly when I click — Martin (MSGJ · talk) 20:54, 10 August 2024 (UTC)[reply]
Why should the overall rank change after sorting by other things? If you sort by lowest to higest, then it doesnt make sense that lowest gives 1st rank. Pelmeen10 (talk) 21:12, 10 August 2024 (UTC)[reply]
I suppose Footy2000 would like to know the rank determined by counting the total number of medals. Maybe the documentation should say clearly that the template uses the gold medal count for the rank (with silver/bronze to break ties), which is the ranking system used e.g. by the International Olympic Committee.--Kallichore (talk) 21:32, 10 August 2024 (UTC)[reply]
Wouldn't it be desirable for long medal tables if the header was sticky at the top of the screen?
Unfortunately, the following template Template:Sticky header cannot be used for medal tables using this template, so the code itself would have to be changed.
For comparison:
the main table(normal wikitable) in the all-time Olympics article the headers are sticky, however not in the other very long ranked table(using the template medals table). But in my opinion it would be a great advantage for the reader. Miria~01 (talk) 13:27, 12 August 2024 (UTC)[reply]
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
As proposed here Template talk:Medals table#Sticky header,
my suggestion is that medal table's headers should stick to the top of the screen as the table's data is scrolled in and out of view. It would be very useful for the reader at tall tables (e.g. All-time ranked table) to see the header as you scroll through the data.
A simple adding of following code lines, where the header row is build, would be sufficient :css('position', 'sticky') :css('top','0') Miria~01 (talk) 10:02, 13 August 2024 (UTC)[reply]
The somewhat-confusing parameter |team= sets the header name; I have fixed the article you listed, but feel free to adjust elsewhere as necessary. Primefac (talk) 10:16, 15 June 2025 (UTC)[reply]
Template:Medals table has implented {{sticky header}} in their code (...local sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky header/styles.css) and it works perfectly and is a great addition. However, there are also very long tables, and it would be good if they were scrollable in a container like {{sticky table start}}. In All-time Olympic Games medal table, we even have three long tables one after the other, and that's not good.
Sticky header is probably the preferred choice, as no container is placed around the table.
However, a parameter for the template would be desirable for very long tables.
with these changes in {{Template:Medals table}}, this switch would work, tested with Module:Sandbox/Miria~01/2 on User:Miria~01/sandbox2 with {{#invoke:Sandbox/Miria~01/2|createTable|style=alt for the first table and for the second table with {{#invoke:Sandbox/Miria~01/2|createTable. These would be the changes in {{Module:Medals table}}
This would not change anything for all other medal tables, and you would only need to insert {{Medals table|style=alt when calling the template, if desired. Miria~01 (talk) 18:55, 18 June 2025 (UTC)[reply]