Template:Format columns/doc
Чөлөөт нэвтэрхий толь Википедиагаас
![]() |
Энэ бол заавар, категори, эсвэл бусад мэдээлэл техникийн зориулалтаар хадгалагддаг зааврын дэд хуудас юм. Template хуудсыг нь үзэхийг хүсвэл, Template:Format columns-ийг үзнэ үү. |
Note: The contents of this template are only visible when included in another page with parameters.
↓ Skip to English language Documentation ↓
|
[Өөрчлөх] Баримт бичиг
[Өөрчлөх] xxx
[Өөрчлөх] Өгүүлбэр зүй
[Өөрчлөх] Жишээ
[Өөрчлөх] Documentation
This template provides a method to display content in columns, optionally with a header each. There is a maximum number of 10 columns, any input with higher numbers will be ignored.
One of the purposes of this template is to be used within other templates, such as in the body area of {{Navigation bar}}.
[Өөрчлөх] Syntax
{{Format columns | head_1 = heading of first column | col_1 = content of first column | head_2 = heading of second column | col_2 = content of second column | head_3 = heading of third column | col_3 = content of third column }}
[Өөрчлөх] Parameters
[Өөрчлөх] Mandatory
- data_1, data_2, etc.
- Obviously, without supplying content for at least two columns, using this template doesn't make sense. The content can be anything, but pipe characters must be escaped by {{!}} and friends, or they may confuse the wiki parser.
[Өөрчлөх] Optional
- label_1, label_2, etc.
- If at least one of the heading parameters is set, then headers will be placed at the top of all columns. Supplying either column content or a column header will generate the respective column. If only one of the two is specified for a column, then the other field will be empty.
- title
- Text given here will appear as a title on top of the colums and headers.
- image
- A full image link given here will be displayed to the right of the data fields in a seperate area. The data_1 entry must be present for this to work. Adding images to navbars is not recommended though, because in most cases the available space is already limited enough.
[Өөрчлөх] Styles
Elements can be styled collectively or individually. Style arguments should be used sparingly, as the defaults may already provide for an acceptable look. Especially when embedded in other templates, the formatting should be kept to an absolute minimum.
- style
- formats the underlying table, eg. for a border around everything, etc.
- title_style
- formats the title
- label_style
- formats all headers collectively (no border/margin/padding).
- label_1_style, label_2_style, etc.
- formats individual headers.
- data_style
- formats all columns collectively (no border/margin/padding).
- data_1_style, data_2_style, etc.
- formats individual columns.
- label_even_style, label_odd_style,
- data_even_style, data_odd_style
- format label or data fields with even or odd numbers respectively.
- image_style
- formats the table cell containing the image.
[Өөрчлөх] Example
This example shows how how {{Format columns}} works together with {{Navigation bar}} (and possibly other templates).
[Өөрчлөх] Source
{{Navigation bar | name = Format_columns/doc | title = Navigation bar with columns | icon_right = [[Image:Flag of Mongolia.svg|40px]] | above = a field above the content (belonging to {{Template|Navigation bar}}) | below = a field below the content (belonging to {{Template|Navigation bar}}) | body ={{Format columns | label_1 = first column | data_1 = 1111 11 11 | label_2 = second column | data_2 = * 2 22 222 222 2 * 2 22 * 222 222 2 22 * 222 222 2 22 222 | label_3 = third column | data_3 = 3 33 333 333 3 33 333 33 3 33 333 3333 3 33 333 333 | label_4 = fourth column | data_4 = <div> #4444 4 44 #44 4 44 #44 4 44444 #44 4 44 </div><!-- XXX The div is a workaround for a wiki-bug: The very last element in "Format columns" MUST NOT be a list, or the "below" field of the navbar will do weird stuff. --> }} }}
[Өөрчлөх] Result
Navigation bar with columns | ![]() |
||||||||
---|---|---|---|---|---|---|---|---|---|
a field above the content (belonging to {{Navigation bar}}) | |||||||||
|
|||||||||
a field below the content (belonging to {{Navigation bar}}) |
[Өөрчлөх] See also
- {{Navigation bar}} - a hull where this template fits in
- {{Format rows}} - an alternative formatting option