Jump to content

Template:Diagonal split header

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Cmglee (talk | contribs) at 19:51, 9 January 2016 (Document). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This template simulates a table header cell split diagonally, a device often used to compactly label headers of rows and columns, as in this example:

  Handed-
ness
  Sex
Right-handed Left-handed Total
Male 43 9 52
Female 44 4 48
Total 87 13 100

To use it, create a header cell using ! followed by {{diagonal split header|HEADER-OF-ROW-HEADERS|HEADER-OF-COLUMN-HEADERS}}.

As the effect is achieved by drawing a diagonal line across the cell, the two headers are still part of the same cell and can easily overrun the line. A remedy is to pad the headers horizontally with &nbsp; and vertically with <br /> as in the example above. The template user is responsible for checking that it does not overrun on common Web browsers.

The template is compatible with cells using colspan or rowspan, in which case place the colspan/rowspan attribute between ! and {{diagonal split header …}}:

H
θ
5′ 7″ 5′ 10″ 6′ 1″
67″ 70″ 73″
0
π/2 90°
π 180°