Jump to content

Template talk:Medals table

From Calamity Wiki

Template:Talk header Template:Permanently protected

Adding a switch parameter for Template:Sticky table start

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}}

local stylesheet = args['style']
local sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky header/styles.css" } }
local sticky
if stylesheet == 'alt' then
        sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky table start/styles.css"} }
else
sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky header/styles.css"} }
end
...
...
if stylesheet == 'alt' then
root:addClass('sticky-table-head')
else
	   root:addClass('sticky-header-multi')
end
		root:css('text-align', 'center)

...
...

if stylesheet == 'alt' then
  local container = mw.html.create('div')
  :addClass('sticky-table-scroll')
  :wikitext(tostring(root))

  local outerContainer = mw.html.create('div')
  :addClass('sticky-table-collapsible')
  :node(container)
 return header .. sticky .. tostring(outerContainer) .. footer
else
return header .. sticky .. tostring(root) .. footer
end
end

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)

Removed the request "edit be made to the template-protected", because the matter has been resolved (see here). {{sticky table start}} works now with the integrated {{sticky header}} in {{#invoke:Medals table}}.
<div style="font-size:90%">
{{sticky table start}} 
{{Medals table
 | caption        =
 | host           =
 | remaining_text =
 | show_limit =
 | team           = {{Tooltip|NOC|National Olympic Committee}}
 | flag_template  = flagIOC
 | event          = Summer
 | gold_USA = 1105| silver_USA = 879 | bronze_USA = 781
 ...
|}
{{sticky table end}}
Miria~01 (talk) 23:04, 26 June 2025 (UTC)

flag_template with age parameter

{{fbu}} and {{fbwu}} have an unnamed age parameter before the other unnamed parameters. Can {{Medals table}} be adapted to allow passing on such a parameter with something like |flag_template=fbwu |age=17? I made a wrapper template {{fbwu17}} which doesn't itself have an age parameter and that works.[1] But a bunch of wrapper templates for gender-age combinations doesn't seem like a good solution. This started at Wikipedia:Help desk#Template for women's football under-20 and under-17. PrimeHunter (talk) 14:39, 11 July 2025 (UTC)

Oh yes PrimeHunter, this template is terrible. No one can make such a small Lua fix. The {{Winners}} template had a similar problem with youth categories, but I recently fixed it; you can look at it if you want. However, Lua is completely unknown to me; I cannot modify the Module:Medals table myself... Maiō T. (talk) 11:11, 8 March 2026 (UTC)

Sync with sandbox

Template:Edit template-protected Semantic HTML and accessibility improvements there (totals no longer use <th> for data cells). sapphaline (talk) 12:09, 6 December 2025 (UTC)

  •  Done, looks good, thanks :) --Nux (talk) 16:45, 6 December 2025 (UTC)

Unnecessary inherit

Hi, I'm currently theming my wikis and noticed an unnecessary attribute for the Rank field. If you go to any article (I chose 2025_World_Figure_Skating_Championships because it was on main page) and change color attribute of .wikitable, you can see that all headers remain black except for rank. Removing inherit from Rank makes it black again, like the rest of headers. The only exception is Timeless theme, where all headers with default background get that color). Lili1228 (talk) 09:24, 3 April 2026 (UTC)

I don't see any problems with the display of this template, including the Rank column header, at 2025 World Figure Skating Championships#Medals by country in the Vector 2022 default mode or the Vector 2022 dark mode. There are also no dark-mode-related Linter errors on that page. What is the problem that you are reporting? Screen shots might help. – Jonesey95 (talk) 16:53, 5 April 2026 (UTC)
As I said, this affects custom CSS (that themes .wikitable), I don't have any issue on any of the stock themes. If you apply something like .wikitable { color: red; }, you'll see that all the text in the first row becomes red but Rank's color: inherit; causes an inconsistency. Lili1228 (talk) 18:11, 5 April 2026 (UTC)
Thank you for clarifying. Feel free to propose a change in the sandbox that fixes your personal issue while continuing to support the standard skins and viewing modes. – Jonesey95 (talk) 20:39, 5 April 2026 (UTC)
In Module:Medals_table, remove the css line from:
	if not args['hide_rank'] then
		row:tag('th')
			:attr('scope', 'col')
			:css('color', 'inherit')
			:wikitext('Rank')
	end
Lili1228 (talk) 20:43, 5 April 2026 (UTC)
 Done. I do not see any problems in the views that I described, so this looks like a harmless change. – Jonesey95 (talk) 00:35, 6 April 2026 (UTC)