Difference between revisions of "Template:Diagonal split header/doc"
>Mornsta-gpuser |
>Mornsta-gpuser |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | {{doc/start}} | ||
== Usage == | == Usage == | ||
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: | 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: | ||
{| class="wikitable" style="margin:0 auto;text-align:center;" | {| class="wikitable" style="margin:0 auto;text-align:center;" | ||
| − | ! {{diagonal split header| | + | ! {{diagonal split header|From|To}} ! Solid !! Liquid !! Gas |
|- | |- | ||
! Solid | ! Solid | ||
| Line 14: | Line 15: | ||
|} | |} | ||
| − | To use it, create a header cell using <code>!</code> followed by <code><nowiki>{{diagonal split header|NATURE-OF-ROW-HEADERS|NATURE-OF-COLUMN-HEADERS}}</nowiki></code>. | + | To use it, create a header cell using <code>!</code> followed by <code><nowiki>{{diagonal split header|NATURE-OF-ROW-HEADERS|NATURE-OF-COLUMN-HEADERS|COLOR-OF-ROW-HEADERS|COLOR-OF-COLUMN-HEADERS}}</nowiki></code>. |
| − | 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 with non-breaking spaces (<code>&nbsp;</code>), line breaks {{nobr|(<code><br /></code>),}} and/or CSS (escape <code>=</code> signs as <code><nowiki>{{=}}</nowiki></code>) | + | 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 with non-breaking spaces (<code>&nbsp;</code>), line breaks {{nobr|(<code><br /></code>),}} and/or CSS (escape <code>=</code> signs as <code><nowiki>{{=}}</nowiki></code>). The template user is responsible for checking that it does not overrun on common Web browsers. |
=== Background colour and non-header cells === | === Background colour and non-header cells === | ||
| − | A third parameter can be added to change the background colour from the standard header cell colour. Changing it to <code>transparent</code> (or another colour such as <code>white</code>, or <code>#ffffff</code>) lets the template be applied to non-header cells. | + | A third and fourth parameter can be added to change the background colour from the standard header cell colour. Changing it to <code>transparent</code> (or another colour such as <code>white</code>, or <code>#ffffff</code>) lets the template be applied to non-header cells. |
| − | + | {{doc/end}} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Latest revision as of 02:15, 23 March 2019
Usage
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:
To From
|
Solid | Liquid | Gas |
|---|---|---|---|
| Solid | Solid-solid transformation | Melting | Sublimation |
| Liquid | Freezing | — | Boiling/evaporation |
| Gas | Deposition | Condensation | — |
To use it, create a header cell using ! followed by {{diagonal split header|NATURE-OF-ROW-HEADERS|NATURE-OF-COLUMN-HEADERS|COLOR-OF-ROW-HEADERS|COLOR-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 with non-breaking spaces ( ), line breaks (<br />), and/or CSS (escape = signs as {{=}}). The template user is responsible for checking that it does not overrun on common Web browsers.
Background colour and non-header cells
A third and fourth parameter can be added to change the background colour from the standard header cell colour. Changing it to transparent (or another colour such as white, or #ffffff) lets the template be applied to non-header cells.