Difference between revisions of "Template:Infobox"
From LFS Manual
Jump to navigationJump to searchm |
m |
||
| Line 18: | Line 18: | ||
text-align: center; | text-align: center; | ||
padding: 0.2em; | padding: 0.2em; | ||
| + | {{{titlestyle|}}} | ||
">{{{title}}}</caption>}} | ">{{{title}}}</caption>}} | ||
{{#if:{{{above|}}}| | {{#if:{{{above|}}}| | ||
<tr> | <tr> | ||
| − | <th colspan="2" style="text-align: center; font-size: 125%;">{{{above}}}</th> | + | <th colspan="2" style="text-align: center; font-size: 125%; {{{abovestyle|}}}">{{{above}}}</th> |
</tr>}} | </tr>}} | ||
{{#if:{{{subheader|}}}| | {{#if:{{{subheader|}}}| | ||
<tr> | <tr> | ||
| − | <td colspan="2" style="text-align: center">{{{subheader}}}</td> | + | <td colspan="2" style="text-align: center; {{{subheaderstyle|}}}">{{{subheader}}}</td> |
</tr>}} | </tr>}} | ||
{{#if:{{{image|}}}| | {{#if:{{{image|}}}| | ||
<tr> | <tr> | ||
| − | <td colspan="2" style="text-align: center">{{{image}}} | + | <td colspan="2" style="text-align: center; {{{imagestyle|}}}">{{{image}}} |
| − | <div style="text-align: center">{{{caption}}}</div> | + | <div style="text-align: center; {{{captionstyle|}}}">{{{caption}}}</div> |
</td> | </td> | ||
</tr>}} | </tr>}} | ||
| Line 39: | Line 40: | ||
{{#if:{{{header1|}}}| | {{#if:{{{header1|}}}| | ||
<tr> | <tr> | ||
| − | <th colspan="2" style="text-align: center; {{{header1style|{{{headerstyle}}} | + | <th colspan="2" style="text-align: center; {{{header1style|{{{headerstyle}}}}}}">{{{header1}}}</th> |
</tr> | </tr> | ||
}} | }} | ||
{{#if:{{{data1|}}}| | {{#if:{{{data1|}}}| | ||
{{#if:{{{label1|}}} | {{#if:{{{label1|}}} | ||
| − | | <th scope="row" style="text-align: left; vertical-align: top">{{{label1}}}</th> | + | | <th scope="row" style="text-align: left; vertical-align: top; {{{labelstyle|}}}">{{{label1}}}</th> |
| − | <td scope="row" style="text-align: left; vertical-align: top">{{{data1}}}</td> | + | <td scope="row" style="text-align: left; vertical-align: top; {{{datastyle|}}}">{{{data1}}}</td> |
| − | | <td scope="row" style="text-align: center; vertical-align: top" colspan="2">{{{data1}}}</td> | + | | <td scope="row" style="text-align: center; vertical-align: top; {{{datastyle|}}}" colspan="2">{{{data1}}}</td> |
}} | }} | ||
}} | }} | ||
| Line 52: | Line 53: | ||
{{#if:{{{header2|}}}| | {{#if:{{{header2|}}}| | ||
<tr> | <tr> | ||
| − | <th colspan="2" style="text-align: center; {{{header2style|{{{headerstyle}}} | + | <th colspan="2" style="text-align: center; {{{header2style|{{{headerstyle}}}}}}">{{{header2}}}</th> |
</tr> | </tr> | ||
}} | }} | ||
{{#if:{{{data2|}}}| | {{#if:{{{data2|}}}| | ||
{{#if:{{{label2|}}} | {{#if:{{{label2|}}} | ||
| − | | <th scope="row" style="text-align: left; vertical-align: top">{{{label2}}}</th> | + | | <th scope="row" style="text-align: left; vertical-align: top; {{{labelstyle|}}}">{{{label2}}}</th> |
| − | <td scope="row" style="text-align: left; vertical-align: top">{{{data2}}}</td> | + | <td scope="row" style="text-align: left; vertical-align: top; {{{datastyle|}}}">{{{data2}}}</td> |
| − | | <td scope="row" style="text-align: center; vertical-align: top" colspan="2">{{{data2}}}</td> | + | | <td scope="row" style="text-align: center; vertical-align: top; {{{datastyle|}}}" colspan="2">{{{data2}}}</td> |
}} | }} | ||
}} | }} | ||
Revision as of 18:48, 7 December 2023
Template documentation
Generic infobox template. Core infobox template for other, specialized templates, for example {{Infobox car}} and {{Infobox league}}.
Usage
Basic
| Markup | Renders as | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox
| above = Text above
| subheader = Subheader of the infobox
| header1 = Header 1 text
| label1 = Label 1
| data1 = Data 1
| header2 = Header 2 text
| label2 = Label 2
| data2 = Data 2
| header3 = Header 3 text
| data3 = Data 3
}}
|
| ||||||||||||
All parameters
| Text above | |
|---|---|
| Subheader of the infobox | |
Caption below image 1
|
|
| Header 1 text | |
| Label 1 | Data 1 |
| Header 2 text | |
| Label 2 | Data 2 |
Without any parameters
| Markup | Renders as |
|---|---|
{{Infobox}}
|
|
Custom styles
| Markup | Renders as | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox
| titlestyle = background: #ddd;
| abovestyle = background: #cfc;
| subheaderstyle = background: #ffc;
| title = Text in caption over infobox
| above = Text above
| subheader = Subheader of the infobox
| headerstyle = background: #ccf;
| labelstyle = background: #ddf;
| datastyle = background: #dedede;
| header1 = Header 1 text
| label1 = Label 1
| data1 = Data 1
| header2style = background: #cff;
| header2 = Header 2 text
| data2 = Data 2
}}
|
| ||||||||||||
Only data rows
| Markup | Renders as | ||||||||
|---|---|---|---|---|---|---|---|---|---|
{{Infobox
| above = Text above
| subheader = Subheader of the infobox
| label1 = Label 1
| data1 = Data 1
| label2 = Label 2
| data2 = Data 2
| label3 = Label 3
| data3 = Data 3
| data4 = Data 4
| data5 = Data 5
}}
|
| ||||||||