• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Plain row headers

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]
This template is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used in article namespace pages. Templates remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure.
CSSThis template uses TemplateStyles:
  • Template:Plain row headers/styles.css

This template provides the styles for plain row headers, specifically in wikitable CSS class tables. It makes row-scoped table headers normal font weight and text-aligned left, and also has an option for center-aligned text.

Blockers for use currently

  • There are currently 125k pages that use the plainrowheaders class, of which 118k are in main space. It is prohibitive to do this by hand. A bot request will be started.
  • WP:TemplateStyles may at some arbitrary point in the future apply only to the template they are transcluded from. This case is not currently "supported". See phab:T176272.
    • The wider community was notified and nothing of interest was discussed. In other discussion from the content transform team members, the HTML emitted does not make this an issue.
  • Don't create the natural redirect {{plainrowheaders}} (yet, maybe ever). This will assist tracking of addition of this template to pages as well as needed addition to pages. Tracking search.

Usage

Add the text class="wikitable plain-row-headers" or class="wikitable plain-row-headers-center" to a table. Above that table, add this template. Add this template above every such table on a single page.

While stuff may work today with only a single use, there are a few reasons why you should add it multiple times: 1) The CSS is 'deduplicated', meaning it only appears once on the page regardless; 2) It is easier for a newbie to learn and associate what's going on with these styles if the template is near to where the table using them is placed; and 3) it will be less confusing in section edit when the styles don't show up to explain that the template is located elsewhere on the page and so it should be added to the table where it is used currently.

Example

Wikitext Produces
{| class="wikitable"
|+ Example normal wikitable
|-
! scope="col" | Col header
! scope="col" | Col header
! scope="col" | Col header
|-
! scope="row" | Row header
| A
| B
|-
! scope="row" | Row header long
| C
| D
|}
Example normal wikitable
Col header Col header Col header
Row header A B
Row header long C D
{{plain row headers}}
{| class="wikitable plain-row-headers"
|+ Wikitable with plain row headers 
|-
! scope="col" | Col header
! scope="col" | Col header
! scope="col" | Col header
|-
! scope="row" | Row header
| A
| B
|-
! scope="row" | Row header long
| C
| D
|}
Wikitable with plain row headers
Col header Col header Col header
Row header A B
Row header long C D
{{plain row headers}}
{| class="wikitable plain-row-headers-center"
|+ Wikitable with center-aligned plain row headers 
|-
! scope="col" | Col header
! scope="col" | Col header
! scope="col" | Col header
|-
! scope="row" | Row header
| A
| B
|-
! scope="row" | Row header long
| C
| D
|}
Wikitable with center-aligned plain row headers
Col header Col header Col header
Row header A B
Row header long C D
The above documentation is transcluded from Template:Plain row headers/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Plain_row_headers&oldid=1107446379"
Last edited on 30 August 2022, at 01:44

Languages

    • Русский
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 30 August 2022, at 01:44 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop