https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ANPVIC_table
Module:NPVIC table - Revision history
2025-06-30T00:24:43Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.7
https://en.wikipedia.org/w/index.php?title=Module:NPVIC_table&diff=1219207134&oldid=prev
Brainiac242: Aligned EVs to the center (they look weird aligned to the right)
2024-04-16T10:48:45Z
<p>Aligned EVs to the center (they look weird aligned to the right)</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:48, 16 April 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 71:</td>
<td colspan="2" class="diff-lineno">Line 71:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):attr('class','unsortable'):wikitext('Method of adoption')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):attr('class','unsortable'):wikitext('Method of adoption')</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):attr('class','unsortable'):wikitext(reference_heading)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):attr('class','unsortable'):wikitext(reference_heading)</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext('Current<br/>electoral<br/>votes (<del style="font-weight: bold; text-decoration: none;">EV</del>)')</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext('Current<br/>electoral<br/>votes (<ins style="font-weight: bold; text-decoration: none;">EVs</ins>)')</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local k = 1</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local k = 1</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 83:</td>
<td colspan="2" class="diff-lineno">Line 83:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('td'):wikitext(args['method' .. k])</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('td'):wikitext(args['method' .. k])</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('td'):css('text-align','center'):wikitext(args['ref' .. k])</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('td'):css('text-align','center'):wikitext(args['ref' .. k])</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> row:tag('td'):css('text-align','<del style="font-weight: bold; text-decoration: none;">right</del>'):wikitext(tonumber(seats) + 2)</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> row:tag('td'):css('text-align','<ins style="font-weight: bold; text-decoration: none;">center</ins>'):wikitext(tonumber(seats) + 2)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> EVs = EVs + tonumber(seats) + 2</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> EVs = EVs + tonumber(seats) + 2</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> k = k + 1</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> k = k + 1</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 91:</td>
<td colspan="2" class="diff-lineno">Line 91:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row = root:tag('tr'):addClass('sortbottom')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row = root:tag('tr'):addClass('sortbottom')</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('colspan', 5):css('text-align', 'right'):wikitext('Total')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('colspan', 5):css('text-align', 'right'):wikitext('Total')</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):css('text-align', '<del style="font-weight: bold; text-decoration: none;">right</del>'):wikitext(EVs)</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):css('text-align', '<ins style="font-weight: bold; text-decoration: none;">center</ins>'):wikitext(EVs)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row = root:tag('tr'):addClass('sortbottom')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row = root:tag('tr'):addClass('sortbottom')</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('colspan', 5):css('text-align', 'right'):wikitext('Percentage of the 270 EVs needed')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('colspan', 5):css('text-align', 'right'):wikitext('Percentage of the 270 EVs needed')</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):css('text-align', '<del style="font-weight: bold; text-decoration: none;">right</del>'):wikitext(percent)</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):css('text-align', '<ins style="font-weight: bold; text-decoration: none;">center</ins>'):wikitext(percent)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return root</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return root</div></td>
</tr>
</table>
Brainiac242
https://en.wikipedia.org/w/index.php?title=Module:NPVIC_table&diff=1151515028&oldid=prev
Swpb: No point in these two columns being sortable
2023-04-24T15:00:45Z
<p>No point in these two columns being sortable</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:00, 24 April 2023</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 69:</td>
<td colspan="2" class="diff-lineno">Line 69:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext('Jurisdiction')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext('Jurisdiction')</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):attr('data-sort-type', 'date'):wikitext('Date adopted')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):attr('data-sort-type', 'date'):wikitext('Date adopted')</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext('Method of adoption')</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col<ins style="font-weight: bold; text-decoration: none;">'):attr('class','unsortable</ins>'):wikitext('Method of adoption')</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext(reference_heading)</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col<ins style="font-weight: bold; text-decoration: none;">'):attr('class','unsortable</ins>'):wikitext(reference_heading)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext('Current<br/>electoral<br/>votes (EV)')</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> row:tag('th'):attr('scope', 'col'):wikitext('Current<br/>electoral<br/>votes (EV)')</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td>
</tr>
</table>
Swpb
https://en.wikipedia.org/w/index.php?title=Module:NPVIC_table&diff=1149960342&oldid=prev
Brainiac242: Used DC’s formal name for consistency in the article National Popular Vote Interstate Compact
2023-04-15T14:14:20Z
<p>Used DC’s formal name for consistency in the article <a href="/wiki/National_Popular_Vote_Interstate_Compact" title="National Popular Vote Interstate Compact">National Popular Vote Interstate Compact</a></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:14, 15 April 2023</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 10:</td>
<td colspan="2" class="diff-lineno">Line 10:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["CT"] = "[[Connecticut]]",</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["CT"] = "[[Connecticut]]",</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["DE"] = "[[Delaware]]",</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["DE"] = "[[Delaware]]",</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> ["DC"] = "[[Washington, D.C.]]",</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> ["DC"] = "[[Washington, D.C.<ins style="font-weight: bold; text-decoration: none;">|District of Columbia</ins>]]",</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["FL"] = "[[Florida]]",</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["FL"] = "[[Florida]]",</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["GA"] = "[[Georgia (U.S. state)|Georgia]]",</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["GA"] = "[[Georgia (U.S. state)|Georgia]]",</div></td>
</tr>
</table>
Brainiac242
https://en.wikipedia.org/w/index.php?title=Module:NPVIC_table&diff=1146259589&oldid=prev
Frietjes: for use in National Popular Vote Interstate Compact
2023-03-23T19:21:22Z
<p>for use in <a href="/wiki/National_Popular_Vote_Interstate_Compact" title="National Popular Vote Interstate Compact">National Popular Vote Interstate Compact</a></p>
<p><b>New page</b></p><div>local p = {}<br />
<br />
local state_links = {<br />
["AL"] = "[[Alabama]]",<br />
["AK"] = "[[Alaska]]",<br />
["AZ"] = "[[Arizona]]",<br />
["AR"] = "[[Arkansas]]",<br />
["CA"] = "[[California]]",<br />
["CO"] = "[[Colorado]]",<br />
["CT"] = "[[Connecticut]]",<br />
["DE"] = "[[Delaware]]",<br />
["DC"] = "[[Washington, D.C.]]",<br />
["FL"] = "[[Florida]]",<br />
["GA"] = "[[Georgia (U.S. state)|Georgia]]",<br />
["HI"] = "[[Hawaii]]",<br />
["ID"] = "[[Idaho]]",<br />
["IL"] = "[[Illinois]]",<br />
["IN"] = "[[Indiana]]",<br />
["IA"] = "[[Iowa]]",<br />
["KS"] = "[[Kansas]]",<br />
["KY"] = "[[Kentucky]]",<br />
["LA"] = "[[Louisiana]]",<br />
["ME"] = "[[Maine]]",<br />
["MD"] = "[[Maryland]]",<br />
["MA"] = "[[Massachusetts]]",<br />
["MI"] = "[[Michigan]]",<br />
["MN"] = "[[Minnesota]]",<br />
["MS"] = "[[Mississippi]]",<br />
["MO"] = "[[Missouri]]",<br />
["MT"] = "[[Montana]]",<br />
["NE"] = "[[Nebraska]]",<br />
["NV"] = "[[Nevada]]",<br />
["NH"] = "[[New Hampshire]]",<br />
["NJ"] = "[[New Jersey]]",<br />
["NM"] = "[[New Mexico]]",<br />
["NY"] = "[[New York (state)|New York]]",<br />
["NC"] = "[[North Carolina]]",<br />
["ND"] = "[[North Dakota]]",<br />
["OH"] = "[[Ohio]]",<br />
["OK"] = "[[Oklahoma]]",<br />
["OR"] = "[[Oregon]]",<br />
["PA"] = "[[Pennsylvania]]",<br />
["RI"] = "[[Rhode Island]]",<br />
["SC"] = "[[South Carolina]]",<br />
["SD"] = "[[South Dakota]]",<br />
["TN"] = "[[Tennessee]]",<br />
["TX"] = "[[Texas]]",<br />
["UT"] = "[[Utah]]",<br />
["VT"] = "[[Vermont]]",<br />
["VA"] = "[[Virginia]]",<br />
["WA"] = "[[Washington (state)|Washington]]",<br />
["WV"] = "[[West Virginia]]",<br />
["WI"] = "[[Wisconsin]]",<br />
["WY"] = "[[Wyoming]]"<br />
}<br />
<br />
function p._showtable(frame, args)<br />
local reference_heading = frame:expandTemplate{title = 'Reference column heading'}<br />
local root = mw.html.create('table')<br />
:addClass('wikitable sortable')<br />
:css('line-height', 1.2)<br />
:css('margin-left', 'auto')<br />
:css('margin-right', 'auto')<br />
-- table title<br />
root:tag('caption'):wikitext('Jurisdictions enacting law to join the National Popular Vote Interstate Compact')<br />
-- header row<br />
local row = root:tag('tr')<br />
row:tag('th'):attr('scope', 'col'):wikitext('No.')<br />
row:tag('th'):attr('scope', 'col'):wikitext('Jurisdiction')<br />
row:tag('th'):attr('scope', 'col'):attr('data-sort-type', 'date'):wikitext('Date adopted')<br />
row:tag('th'):attr('scope', 'col'):wikitext('Method of adoption')<br />
row:tag('th'):attr('scope', 'col'):wikitext(reference_heading)<br />
row:tag('th'):attr('scope', 'col'):wikitext('Current<br/>electoral<br/>votes (EV)')<br />
<br />
local k = 1<br />
local EVs = 0<br />
while args['state' .. k] do<br />
local seats = args['state' .. k] == 'DC' and 1 or frame:expandTemplate{ title = 'USHRseats', args = {args['state' .. k]}}<br />
row = root:tag('tr')<br />
row:tag('th'):attr('scope', 'row'):wikitext(k)<br />
row:tag('td'):wikitext(state_links[args['state' .. k]] or args['state' .. k])<br />
row:tag('td'):css('text-align','right'):wikitext(args['date' .. k])<br />
row:tag('td'):wikitext(args['method' .. k])<br />
row:tag('td'):css('text-align','center'):wikitext(args['ref' .. k])<br />
row:tag('td'):css('text-align','right'):wikitext(tonumber(seats) + 2)<br />
EVs = EVs + tonumber(seats) + 2<br />
k = k + 1<br />
end<br />
<br />
local percent = frame:expandTemplate{ title = 'percent', args = { EVs, 270, 1} }<br />
row = root:tag('tr'):addClass('sortbottom')<br />
row:tag('th'):attr('colspan', 5):css('text-align', 'right'):wikitext('Total')<br />
row:tag('th'):css('text-align', 'right'):wikitext(EVs)<br />
row = root:tag('tr'):addClass('sortbottom')<br />
row:tag('th'):attr('colspan', 5):css('text-align', 'right'):wikitext('Percentage of the 270 EVs needed')<br />
row:tag('th'):css('text-align', 'right'):wikitext(percent)<br />
<br />
return root<br />
end<br />
<br />
function p.main(frame)<br />
local args = require('Module:Arguments').getArgs(frame)<br />
return p._showtable(frame, args)<br />
end<br />
<br />
return p</div>
Frietjes