Category talk:United States political party shading templates

WikiProject iconPolitics Category‑class
WikiProject iconThis category is within the scope of WikiProject Politics, a collaborative effort to improve the coverage of politics 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.
CategoryThis category does not require a rating on Wikipedia's content assessment scale.

Party shading templates should be made compatible with HTML5-compatible alignment markup edit

A typical party shading template is {{Party shading/Green}}, which inserts: style="background:#17aa5c"; this markup is usually used in table cells. But what if there is a need to align the table cell? Before HTML5, it was acceptable to center with align="center", and that works fine with these templates. Under HTML5, this is considered obsolete, and now we're supposed to use style="text-align:center", but that doesn't work with these templates. For example,

{|class="wikitable"
| a large cell so that centering the next cell down will be apparent
|-
| align=center {{Party shading/Green}} | Joe Smith (HTML4 center) 
|- 
| style="text-align:center" {{Party shading/Green}} | Joe Smith (HTML5 center)
|}
a large cell so that centering the next cell down will be apparent
Joe Smith (HTML4 center)
Joe Smith (HTML5 center)

Recommendation: Modify each of these templates to allow for an alignment option. The syntax could be

  • {{Party shading/Green|center}}
  • {{Party shading/Green|align=center}}

Please discuss and let's see if there's a consensus. —Anomalocaris (talk) 08:13, 8 August 2022 (UTC)Reply