Category talk:United States political party shading templates

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