13,208
edits
(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...") |
(+- Default background color; Doc; cat: Templates) |
||
Line 1: | Line 1: | ||
<includeonly>style="background:linear-gradient(to top right,{{{3|# | <includeonly>style="background:linear-gradient(to top right,{{{3|#f1f1f1}}} 49.5%,#aaa 49.5%,#aaa 50.5%,{{{3|#f1f1f1}}} 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> | ||
{{Informative template|1= | |||
__NOTOC__ | |||
== Goal == | |||
This template will make a cell appear as being split from top left to bottom right. It can be for example be used to have a separate row heading and column heading in the same cell. | |||
{{inote|Long headings might overlap cell borders.}} | |||
== Usage == | |||
<!-- Description of how to use the template --> | |||
{{obr}}'''diagonal split header'''{{!}}row text{{!}}column text{{!}}''background''{{cbr}} | |||
The row and column heading parameters are mandatory. The background parameter is optional. | |||
; row text | |||
: Text in the lower right half of the cell for the rows. | |||
; column text | |||
: Text in the upper right half of the cell for the columns. | |||
; background | |||
: Optional background color. Defaults to '''#f1f1f1''' (typically used in headings, see below). | |||
: For table cells in tables using the '''wikitable''' class backgrounds are: | |||
:* '''#f1f1f1''' for headings. | |||
:* '''#f9f9f9''' for cells. | |||
== Examples == | |||
<pre>{| class="wikitable" | |||
! {{diagonal split header|Rows|Columns}} | |||
! Column 1 !! Column 2 | |||
|- | |||
! Row 1 | |||
| A || B | |||
|- | |||
! Row 2 | |||
| C || D | |||
|}}</pre> | |||
{{{!}} class="wikitable" | |||
! style="background:linear-gradient(to top right, #f1f1f1 49.5%,#aaa 49.5%,#aaa 50.5%, #f1f1f1 50.5%);line-height:1;"{{!}}<div style="margin-left:2em;text-align:right;">Columns</div><div style="margin-right:2em;text-align:left;">Rows</div> | |||
! Column 1 !! Column 2 | |||
{{!-}} | |||
! Row 1 | |||
{{!}} A {{!!}} B | |||
{{!-}} | |||
! Row 2 | |||
{{!}} C {{!!}} D | |||
{{!}}} | |||
== See also == | |||
* [[Help:Tables]] | |||
}} | |||
[[Category:Templates]] | |||
</noinclude> |