Template:Diagonal split header/doc:修订间差异

(创建页面,内容为“== 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: {|…”)
 
无编辑摘要
第1行: 第1行:
<includeonly>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude>
   <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
== 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:

2020年10月26日 (一) 10:51的版本

这是 Template:Diagonal split header模板文档
当直接浏览时,使用变量可能会失效,请不要使用硬编码来代替页面名或地址。


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}}.

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 {{=}}), as in the example above. The template user is responsible for checking that it does not overrun on common Web browsers.

Spanning columns and rows, and collapsible and sortable tables

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:

n
  City
2023 2024 
Dec Jan Feb
Roma Rome 8 1 6
Venezia Venice 3 5 7
Firenze Florence 4 9 2

Template data

# Label Description Example Type Required
1 Rows Header of row headers, shown on the bottom left Y-axis string true
2 Columns Header of column headers, shown on the top right X-axis string true
3 Background colour Optional colour of background, use transparent for standard non-header background. Default = #eaecf0 transparent string false

See also