Open main menu

Changes

Template:Infobox/doc

3,241 bytes added, 16:33, 30 October 2018
Undid revision 866438339 by DenysSaisse (talk)
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Examples ==
Notice how the row doesn't appear in the displayed infobox when a '''label''' is defined without an accompanying '''data''' cell, and how all of them are displayed when a '''header''' is defined on the same row as a '''data''' cell. Also notice that '''subheaders''' are not bold by default like the '''headers''' used to split the main data section, because this role is meant to be for the '''above''' cell :
 
{{Infobox
|name = Infobox/doc
|bodystyle =
 
|titlestyle =
|abovestyle = background:#cfc;
|subheaderstyle =
|title = Test Infobox
|above = Above text
|subheader = Subheader above image
|subheader2 = Second subheader
 
|imagestyle =
|captionstyle =
|image = [[File:Example-serious.jpg|200px|alt=Example alt text]]
|caption = Caption displayed below File:Example-serious.jpg
 
|headerstyle = background:#ccf;
|labelstyle = background:#ddf;
|datastyle =
 
|header1 = Header defined alone
| label1 =
| data1 =
|header2 =
| label2 = Label defined alone does not display (needs data, or is suppressed)
| data2 =
|header3 =
| label3 =
| data3 = Data defined alone
|header4 = All three defined (header, label, data, all with same number)
| label4 = does not display (same number as a header)
| data4 = does not display (same number as a header)
|header5 =
| label5 = Label and data defined (label)
| data5 = Label and data defined (data)
 
|belowstyle = background:#ddf;
|below = Below text
}}
<pre style="overflow:auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle =
|titlestyle =
|abovestyle = background:#1D2A39cfc;
|subheaderstyle =
|title = Test Infobox |above = WezenAbove text |subheader = Subheader above image |subheader2 = Second subheader  |imagestyle = |captionstyle = | image = [[File:wezen logoExample-serious.pngjpg|200px|alt=Example alt text]] |caption = Caption displayed below Example-serious.jpg
|headerstyle = background:#ccf;
|below = Below text
}}
</pre>{{clear}}
 
For this example, the '''bodystyle''' and '''labelstyle''' parameters are used to adjust the infobox width and define a default width for the column of labels:
 
{{Infobox
|name = Infobox/doc
|bodystyle = width:20em
 
|titlestyle =
|title = Test Infobox
 
|headerstyle =
|labelstyle = width:33%
|datastyle =
 
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 
|belowstyle =
|below = Below text
}}
<source lang="sass" highlight="3,9" style="overflow: auto">
{{Infobox
|name = {{subst:PAGENAME}}
|bodystyle = width:20em
 
|titlestyle =
|title = Test Infobox
 
|headerstyle =
|labelstyle = width:33%
|datastyle =
 
|header1 =
| label1 = Label 1
| data1 = Data 1
|header2 =
| label2 = Label 2
| data2 = Data 2
|header3 =
| label3 = Label 3
| data3 = Data 3
|header4 = Header 4
| label4 =
| data4 =
|header5 =
| label5 = Label 5
| data5 = Data 5: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
 
|belowstyle =
|below = Below text
}}
</source>{{clear}}
== Embedding ==
Anonymous user