GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing en.wikipedia.org — Template:Diagonal split header - Wikipedia
UsageThis 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 use it, create a header cell using There are two variants of the template with different – and sadly incompatible – features:
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 (
Background colour and non-header cellsDiagonal split header only A third parameter can be added to change the background colour from the standard header cell colour. Changing it to You may also indicate a second color in the fourth parameter (its default is the same as the third parameter), the first color being used for the lower left half of the cell, the second color being used for the upper right half of the cell. Prefix it with
Wiki markup
{| class="wikitable" style="margin:0 auto;text-align:center;" ! {{diagonal split header| Pair 1 | {{color|#900|Pair 2}} | cyan | yellow}} ! style="width:6em;background:yellow;"| {{color|#900|"Friend" (cooperate)}} ! style="width:6em;background:yellow;"| {{color|#900|"Foe" (defect)}} |- ! style="width:6em;background:cyan "| "Friend" (cooperate) | {{diagonal split header| 1 | {{color|#900|1}} | transparent}} | {{diagonal split header| 0 | {{color|#900|2}} | pink | palegreen}} |- ! style="width:6em;background:cyan "| "Foe" (defect) | {{diagonal split header| 2 | {{color|#900|0}} | palegreen | pink}} | {{diagonal split header| 0 | {{color|#900|0}} | pink}} |} Spanning columns and rows, and collapsible and sortable tablesDiagonal split header 2 recommended The template is compatible with collapsible tables, and cells using colspan or rowspan, in which case place the colspan/rowspan attribute between In large table cells like this, use Diagonal split header 2 to produce a better-looking line, with the same thickness as the cell borders:
Wiki markup
{| class="wikitable sortable mw-collapsible" style="margin:0 auto;text-align:center;" ! colspan="2" rowspan="2" {{diagonal split header 2|City|''n''}} ! {{#expr:{{CURRENTYEAR}} - 1}} ! colspan="2"|{{CURRENTYEAR}} |- ! Dec !! Jan !! Feb |- ! Roma !! Rome | 8 || 1 || 6 |- ! Venezia !! Venice | 3 || 5 || 7 |- ! Firenze !! Florence | 4 || 9 || 2 |} Template data
Technical notes
The above documentation is transcluded from Template:Diagonal split header/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Add categories to the /doc subpage. Subpages of this template. Hidden category: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||