Difference between revisions of "Template:Infobox"

From LFS Manual
Jump to navigationJump to search
m
m
Line 29: Line 29:
 
   </td>
 
   </td>
 
</tr>
 
</tr>
 +
 +
{{#if:{{{header1}}}
 +
|
 
<tr>
 
<tr>
   <th colspan="2" style="text-align: center; background-color:{{{header1bg|#ededed}}};">{{{header1}}}</th>
+
   <th colspan="2" style="text-align: center; {{{header1style|background-color:#ededed}}}">{{{header1}}}</th>
 
</tr>
 
</tr>
<tr>
+
}}
   {{#if:{{{header1|}}}
+
{{#if:{{{data1}}}
| <th scope="row" style="text-align: left; vertical-align: top">{{{header1}}}</th>
+
|
 +
   {{#if:{{{label1|}}}
 +
| <th scope="row" style="text-align: left; vertical-align: top">{{{label1}}}</th>
 
   <td scope="row" style="text-align: left; vertical-align: top">{{{data1}}}</td>
 
   <td scope="row" style="text-align: left; vertical-align: top">{{{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" colspan="2">{{{data1}}}</td>
 
   }}
 
   }}
 +
}}
  
 +
{{#if:{{{header2}}}
 +
|
 +
<tr>
 +
  <th colspan="2" style="text-align: center; {{{header2style|background-color:#ededed}}}">{{{header2}}}</th>
 
</tr>
 
</tr>
 +
}}
 +
{{#if:{{{data2}}}
 +
|
 +
  {{#if:{{{label2|}}}
 +
| <th scope="row" style="text-align: left; vertical-align: top">{{{label2}}}</th>
 +
  <td scope="row" style="text-align: left; vertical-align: top">{{{data2}}}</td>
 +
| <td scope="row" style="text-align: center; vertical-align: top" colspan="2">{{{data2}}}</td>
 +
  }}
 +
}}
 
</table></includeonly><noinclude>
 
</table></includeonly><noinclude>
 
<!--Categories go near the bottom of the /doc page.-->
 
<!--Categories go near the bottom of the /doc page.-->
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 19:30, 7 December 2023

Template Info-Icon.png

Template documentation

View - Edit

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
}}
{{{title}}}
Text above
Subheader of the infobox
{{{image}}}
{{{caption}}}
Header 1 text
Label 1 Data 1
Header 2 text
Label 2 Data 2

All parameters

Text in caption over infobox
Text above
Subheader of the infobox
All LFS cars
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}}
{{{title}}}
{{{above}}}
{{{subheader}}}
{{{image}}}
{{{caption}}}
{{{header1}}}
{{{data1}}}
{{{header2}}}
{{{data2}}}


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
}}
Text in caption over infobox
Text above
Subheader of the infobox
{{{image}}}
{{{caption}}}
Header 1 text
Label 1 Data 1
Header 2 text
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
}}
{{{title}}}
Text above
Subheader of the infobox
{{{image}}}
{{{caption}}}
{{{header1}}}
Label 1 Data 1
{{{header2}}}
Label 2 Data 2