Template:Infobox: Difference between revisions
From WikiMD's Wellness Encyclopedia
CSV import |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{# | <includeonly> | ||
{{ | <div style="border: 1px solid #a2a9b1; background-color: #f9f9f9; padding: 5px; float: right; clear: right; margin: 0 0 1em 1em; width: {{{width|22em}}}; font-size: 90%;"> | ||
< | |||
<!-- Title --> | |||
<div style="background-color: #f8f9fa; text-align: center; font-weight: bold; font-size: 110%;"> | |||
{{{title|{{{name|}}}}}} | |||
</div> | |||
<!-- Image --> | |||
{{#if: {{{image|}}} | |||
| <div style="text-align: center; margin: 5px 0;"> | |||
[[File:{{{image}}}|{{{image_size|frameless}}}|alt={{{image_alt|}}}]] | |||
</div> | |||
}} | |||
<!-- Caption --> | |||
{{#if: {{{caption|}}} | |||
| <div style="text-align: center; font-size: 90%;">{{{caption}}}</div> | |||
}} | |||
<!-- Info rows --> | |||
<table style="width: 100%; border-spacing: 0; margin: 0; padding: 0;"> | |||
{{#if: {{{header1|}}} | <tr><th colspan="2" style="background-color: #cfe2f3; text-align: center;">{{{header1}}}</th></tr> }} | |||
{{#if: {{{label1|}}} | <tr><th style="text-align: left;">{{{label1}}}</th><td>{{{data1}}}</td></tr> }} | |||
{{#if: {{{label2|}}} | <tr><th style="text-align: left;">{{{label2}}}</th><td>{{{data2}}}</td></tr> }} | |||
{{#if: {{{label3|}}} | <tr><th style="text-align: left;">{{{label3}}}</th><td>{{{data3}}}</td></tr> }} | |||
{{#if: {{{label4|}}} | <tr><th style="text-align: left;">{{{label4}}}</th><td>{{{data4}}}</td></tr> }} | |||
{{#if: {{{label5|}}} | <tr><th style="text-align: left;">{{{label5}}}</th><td>{{{data5}}}</td></tr> }} | |||
{{#if: {{{label6|}}} | <tr><th style="text-align: left;">{{{label6}}}</th><td>{{{data6}}}</td></tr> }} | |||
{{#if: {{{label7|}}} | <tr><th style="text-align: left;">{{{label7}}}</th><td>{{{data7}}}</td></tr> }} | |||
{{#if: {{{label8|}}} | <tr><th style="text-align: left;">{{{label8}}}</th><td>{{{data8}}}</td></tr> }} | |||
{{#if: {{{label9|}}} | <tr><th style="text-align: left;">{{{label9}}}</th><td>{{{data9}}}</td></tr> }} | |||
{{#if: {{{label10|}}} | <tr><th style="text-align: left;">{{{label10}}}</th><td>{{{data10}}}</td></tr> }} | |||
</table> | |||
</div> | |||
</includeonly> | |||
<noinclude> | |||
== Usage == | |||
This template is a non-Lua version of `Template:Infobox`. It supports simple infoboxes with up to 10 rows of key-value pairs. | |||
=== Example === | |||
<syntaxhighlight lang="mediawiki"> | |||
{{Infobox | |||
| title = Example Infobox | |||
| image = Example.jpg | |||
| image_size = 250px | |||
| caption = Example caption | |||
| header1 = Section Header | |||
| label1 = First label | |||
| data1 = First data | |||
| label2 = Second label | |||
| data2 = Second data | |||
| label3 = Third label | |||
| data3 = Third data | |||
}} | |||
</syntaxhighlight> | |||
=== Parameters === | |||
* `title` - Main title or name (required). | |||
* `image` - File name of the image. | |||
* `image_size` - Size of the image (optional, defaults to "frameless"). | |||
* `caption` - Caption text below the image. | |||
* `header1` - Header for a section. | |||
* `label1` to `label10` - Labels for rows. | |||
* `data1` to `data10` - Corresponding data for labels. | |||
</noinclude> | </noinclude> | ||
Latest revision as of 11:54, 17 December 2024
Usage[edit]
This template is a non-Lua version of `Template:Infobox`. It supports simple infoboxes with up to 10 rows of key-value pairs.
Example[edit]
{{Infobox
| title = Example Infobox
| image = Example.jpg
| image_size = 250px
| caption = Example caption
| header1 = Section Header
| label1 = First label
| data1 = First data
| label2 = Second label
| data2 = Second data
| label3 = Third label
| data3 = Third data
}}Parameters[edit]
- `title` - Main title or name (required).
- `image` - File name of the image.
- `image_size` - Size of the image (optional, defaults to "frameless").
- `caption` - Caption text below the image.
- `header1` - Header for a section.
- `label1` to `label10` - Labels for rows.
- `data1` to `data10` - Corresponding data for labels.