Difference between revisions of "Template:Diagonal split header"

From Dragalia Lost Wiki
Jump to navigation Jump to search
>Mornsta-gpuser
(Created page with "<includeonly>style="background:linear-gradient(to top right,{{{3|#eaecf0}}} 49.5%,#aaa 49.5%,#aaa 50.5%,{{{3|#eaecf0}}} 50.5%);line-height:1;{{{style|}}}"|<div style="margin-l...")
>Mornsta-gpuser
Line 1: Line 1:
 
<includeonly>style="background:linear-gradient(to top right,{{{3|#eaecf0}}} 49.5%,#aaa 49.5%,#aaa 50.5%,{{{3|#eaecf0}}} 50.5%);line-height:1;{{{style|}}}"|<div style="margin-left:2em;text-align:right;">{{{2}}}</div><div style="margin-right:2em;text-align:left;">{{{1}}}</div></includeonly><noinclude>
 
<includeonly>style="background:linear-gradient(to top right,{{{3|#eaecf0}}} 49.5%,#aaa 49.5%,#aaa 50.5%,{{{3|#eaecf0}}} 50.5%);line-height:1;{{{style|}}}"|<div style="margin-left:2em;text-align:right;">{{{2}}}</div><div style="margin-right:2em;text-align:left;">{{{1}}}</div></includeonly><noinclude>
{{documentation}}
+
{{doc}}
 
</noinclude>
 
</noinclude>

Revision as of 15:35, 21 March 2019

50px Documentation

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 (&nbsp;), 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.