Template:Diagonal split header

From blackwiki
Revision as of 19:51, 9 January 2016 by imported>Cmglee (Document)
Jump to navigation Jump to search

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
Template:Pi/2 90°
Template:Pi 180°