Difference between revisions of "Timeline"

From Sega Retro

(this was more difficult than you might think)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<includeonly><div style="overflow:auto;">{{#vardefine:tlcols|{{#expr:{{{end}}}-{{{start}}}+1}}}}{{#vardefine:tlstart|{{{start|0}}}}}
 
<includeonly><div style="overflow:auto;">{{#vardefine:tlcols|{{#expr:{{{end}}}-{{{start}}}+1}}}}{{#vardefine:tlstart|{{{start|0}}}}}
{| class="bottomtemplate" align="center"
+
{| class="bottomtemplate timeline" align="center"
 
|-
 
|-
 
|class="bottomtemphead" colspan="{{#var:tlcols}}"| '''{{{title|}}}'''
 
|class="bottomtemphead" colspan="{{#var:tlcols}}"| '''{{{title|}}}'''
|-
+
|-style="font-size:12px;"
! {{#loop:i|{{{start}}}|{{#expr:{{#var:tlcols}}-1}}| {{#var:i}} {{!}}{{!}} }} {{{end}}}
+
!style="padding:4px;"| {{#loop:i|{{{start}}}|{{#expr:{{#var:tlcols}}-1}}| {{#if:{{{{{#var:i}}|}}}|{{{{{#var:i}}|}}}|{{#if:{{{trimyears|}}}|{{#sub:{{#var:i}}|-2|2}}|{{#var:i}}}}}} {{!}}{{!}}style="padding:4px;"{{!}} }} {{#if:{{{{{{end}}}|}}}|{{{{{{end}}}|}}}|{{#if:{{{trimyears|}}}|{{#sub:{{{end}}}|-2|2}}|{{{end}}}}}}}
|-
+
|-style="font-size:12px;"
 
{{#if: {{{rows|}}} | {{{rows}}} }}
 
{{#if: {{{rows|}}} | {{{rows}}} }}
 
|}
 
|}
 
</div></includeonly><noinclude>
 
</div></includeonly><noinclude>
 +
 +
==Usage==
 +
<pre>
 +
{{timeline
 +
| title=
 +
| start=
 +
| end=
 +
| trimyears=
 +
| rows=
 +
{{timelinerow|text|start|end
 +
}}
 +
}}
 +
</pre>
 +
 +
===Example===
 
{{timeline
 
{{timeline
 
| title=History of the World
 
| title=History of the World
Line 23: Line 38:
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 17:54, 1 January 2022


Usage

{{timeline
| title=
| start=
| end=
| trimyears=
| rows=
{{timelinerow|text|start|end
}}
}}

Example

History of the World
10 11 12 13 14 15 16 17 18 19 20 21 22 23
Precambrian Jurassic Cretaceous
Neolithic Roman Empire Victorian