Difference between revisions of "Template:Diagonal split header/doc"
imported>DMacks (→Usage: separate section for templatedata) |
(→Usage) |
||
| Line 28: | Line 28: | ||
! Nov !! Dec !! Jan | ! Nov !! Dec !! Jan | ||
|- | |- | ||
| − | ! | + | ! data-sort-value="1" | 0 !! 0° |
| ✔ || ✘|| ✗ | | ✔ || ✘|| ✗ | ||
|- | |- | ||
| − | ! | + | ! data-sort-value="2" | {{pi}}/2 !! 90° |
| ✓ || ✗ || ✘ | | ✓ || ✗ || ✘ | ||
|- | |- | ||
| − | ! | + | ! data-sort-value="3" | {{pi}} !! 180° |
| ✔ || ✔ || ✓ | | ✔ || ✔ || ✓ | ||
|} | |} | ||
Revision as of 02:23, 31 May 2017
| This is a documentation subpage for Template:Diagonal split header. It contains usage information, categories and other content that is not part of the original template page. |
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:
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|NATURE-OF-ROW-HEADERS|NATURE-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 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 collapsible tables, and cells using colspan or rowspan, in which case place the colspan/rowspan attribute between ! and {{diagonal split header …}}. It is not compatible with sortable tables, as the sort arrows are not drawn, but this problem can be resolved by using a second header row:
T θ |
2024 | 2025 | ||
|---|---|---|---|---|
| Nov | Dec | Jan | ||
| 0 | 0° | ✔ | ✘ | ✗ |
| Template:Pi/2 | 90° | ✓ | ✗ | ✘ |
| Template:Pi | 180° | ✔ | ✔ | ✓ |
Template data
simulate a table header cell split diagonally
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Rows | 1 | header of row headers, shown on the bottom left | String | optional |
| Columns | 2 | header of column headers, shown on the top right | String | optional |
| Label | 3 | optional extra header content, shown at the center | String | optional |