Template talk:Election table

message: This needs to allow class="wikitable sortable" to be specifiable in the table.  With all the numeric data in election results it's an obvious feature to have. 
Of course it can't be added willy-nilly.  Existing transclusions will need to explicitly switch sortability on and add class="unsortable" to any relevant columns. Possible implementations: 
# having sortable as a parameter of this template which would be trigger class="wikitable sortable" inside the table 
# having class as a parameter, passed straight through to the table 
# having table-params as a parameter, passed straight through to the table 
# having a separate :Template:Electionsorttable based on this Template
The disadvantage of 3 and maybe of 2 is that the existing table style parameters (border="1" cellpadding="4" cellspacing="1" style="margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; text-align:right; border-collapse: collapse; font-size: 95%;") could be overridden: does that defeat their standardization purpose? jnestorius(talk) 13:17, 25 September 2007 (UTC)
replies: text: The advantage is it's easy to code up the template. The disadvantage is having to maintain two otherwise identical templates in parallel. jnestorius(talk) 21:16, 29 September 2007 (UTC)

text: Lots of templates have optional named parameters.  (e.g. :Template:cite book, title is the only mandatory parameter) Adding an extra optional parameter with default behaviour if it's absent will work in pre-existing transclusions where the parameter will obviously be absent. The wikicode to make this work is a bit complicated; I'm unsure of it, but I'm sure someone else could code it up easily. jnestorius(talk) 14:12, 30 September 2007 (UTC)
replies: text: Do you know whom? Electionworld Talk? 17:58, 30 September 2007 (UTC)
replies: text: No, but it should be easy to request help once we've agreed on precisely what we're looking for. jnestorius(talk) 21:38, 30 September 2007 (UTC)

text: Second that. Would be useful to be able to sort a long table like MEPs for the Netherlands 2009-2014 by party, by group, by number of votes, or by date of entry into the parliament - basically by every single column. Would adding class=sortable to this template not do the trick? Classical geographer (talk) 14:25, 3 August 2009 (UTC)
replies: text: I now noticed the topic has been dicussed before, and have moved these last two remarks below the existing discussion. It seems the technology is not as straightforward as I hoped, but adding an optional parameter sounds great - if someone is willing to program it. Classical geographer (talk) 14:28, 3 August 2009 (UTC)
thread_title:  Sortable 

message: Please change the discuss and edit links to something like "v • d • e" used everywhere. Thanks. This shouldn't be protected. ☆ CieloEstrellado 15:33, 29 October 2007 (UTC)
thread_title: Links

message: I dont understand the purpose of this template. Why dont we just build the table in the article space, instead of a template-space? kawaputratorque 12:01, 16 February 2008 (UTC)
thread_title:  Query 

message: In Mozilla Firefox the title bunches around the edges of links. Could someone please fix this. ChrisDHDR 07:41, 9 May 2008 (UTC)
thread_title:  Title 

message: If this is the preferred template, and Template:Election table is not but continues to be used/abused, then merging the two and redirecting the other here should fix any conficts. - Trevor MacInnis (Contribs) 15:11, 3 October 2008 (UTC)
thread_title:  Merge 

message: I propose changing the [edit] [discuss] links to use 
 
which would produce 
 
Any objections?  Thanks! Plastikspork (talk) 23:44, 22 July 2009 (UTC)
thread_title:  Proposed change to edit/discuss links 

message: I've made Template:Electiontable/proposed which adds 3 features. The first 2 are suggested above.
* Changes [edit] [discuss] links to use .
* Has a  parameter if you want to make your table sortable. This is off by default as you need to tweak each template to make this work. 
* Allows title to be in the format  in addition to the current  Title. I'm adding this to make this template use navbar in the same way most of the other templates do.
The changes are backwards compatible: I've tested it on :Template:United Kingdom parliamentary election, 2005 and the example code on the page. --h2g2bob (talk) 22:11, 16 August 2009 (UTC)
replies: text: —TheDJ (talk • contribs) 22:43, 16 August 2009 (UTC)
thread_title:  Proposed solution: sortable, v/e/d 

message: Is there a reason the reader should be prevented from viewing a redirected talk page, when pressing the 'd' link? 117Avenue (talk) 00:02, 30 July 2011 (UTC)
thread_title:  Talk link 

message: If you look at Colombian presidential election, 2006 you can see that in the absence of a template giving metadata for the party's "shortname" it inserts the text "Alternative Democratic Pole|Template:Alternative Democratic Pole/meta/shortname". Obviously that can be fixed in this one instance by creating the relevant metadata, but is there a way the table can be changed so that in the absence of a "shortname" template, it just inserts the name?--82.35.251.109 (talk) 02:45, 30 June 2012 (UTC)
replies: text: You want Template:Infobox election, there you'll see that the party_name parameter does what you want. 117Avenue (talk) 05:44, 30 June 2012 (UTC)
thread_title:  Problem with absent metadata 

message: The View/edit links look a bit odd.  Can we do away with them. They are no used very often anyway (IMO). -- Alan Liefting (talk - contribs) 22:26, 17 August 2012 (UTC)
replies: text: When this template, is used in a template, that can't be edited from an article, it is appropriate to have a link that can get you there. 117Avenue (talk) 05:22, 18 August 2012 (UTC)
replies: text: If, for arguments sake, the links were not there editors can still get to the template by other means. It is less convenient but given that the templates only get a flurry of editing when first set up they is no need to have the two links there until the death of the WP servers. How about making it optional?  -- Alan Liefting (talk - contribs) 06:01, 18 August 2012 (UTC)
replies: text: They are already optional, since this doesn't have to be used in a template. But I would suggest against removing them, when it is used on a different page. Sure, we know how to get there, but novice users don't, and on election day that is where the flurry of edits come from. If this becomes a problem, protect the page, but hiding links is sneaky, and not the spirit of Wikipedia. 117Avenue (talk) 02:00, 19 August 2012 (UTC)
thread_title:  View/edit links 

message: I believe it was the edit at 11:16, 9 January 2015‎ by User:Gadget850 that has messed up the spacing of all the templates on wikipedia. Please do something to revert it. Thank you. Lmmnhn (talk) 19:19, 14 January 2015 (UTC)
thread_title: Undo

message: Please either make electiontable a wikitable as per <https://en.wikipedia.org/w/index.php?title=Template:Election_table/sandbox&diff=663104224&oldid=642588896>. Note that some styles have been retained. I have tested the changes on the template testcases, however, they are rather uncomprehensive.
87.254.70.96 (talk) 17:08, 19 May 2015 (UTC)
replies: text: Done  - for future reference, please note that you can't have multiple class attributes. Alakzi (talk) 19:46, 19 May 2015 (UTC)
thread_title:  Template-protected edit request on 19 May 2015 

message: Please fix the code editing as to prevent excess spacing from being rendered above table in transclusions, as can be seen from here, for instance. Hildeoc (talk) 05:13, 23 November 2020 (UTC)
replies: text: Not done: I removed a line break in the article, which fixed it for me. Please confirm that looks okay for you too? — Martin (MSGJ · talk) 11:52, 23 November 2020 (UTC)
replies: text:  Thanks for fixing that! It's fine in the article now. However, I don't get why that single blank line caused the rendering of excess line spacing there. Normally, a single blank line in the source code does not evoke this issue, right?--Hildeoc (talk) 09:24, 24 November 2020 (UTC)
replies: text: You're right. There is something not quite right about this template. When I substitute Template:2016DCDem a blank line appears even though there is no blank line showing in the wikicode of Template:Election table. I think a visit to WP:VPT may be needed because I can't see what's wrong. — Martin (MSGJ · talk) 11:28, 24 November 2020 (UTC)
replies: text:   Wikipedia:Village_pump_(technical)#Template:Election_table.--Hildeoc (talk) 22:23, 25 November 2020 (UTC)
replies: text:  This extraneous linespace may be related to Wikimedia parser bug  where nested templates can lose track of whether output is currently at the start of a line or not. I've seen this with  and . If it is the issue, then a workaround is placing a  tag before the table in the template, which for some obscure reason prevents the extra line. —  Jts1882 | talk  15:30, 26 November 2020 (UTC)
thread_title:  Template-protected edit request on 23 November 2020