Difference between revisions of "Template:Master Guide table"

From Yugipedia
Jump to: navigation, search
m (UltimateKuriboh moved page Template:Master Guide 3 table to Template:Master Guide table without leaving a redirect: more appropriate regarding usage)
(store width in a variable so it only has to be calculated once)
 
Line 1: Line 1:
<table class="wikitable" style="text-align: center; {{ #if: {{{nocenter|}}} || margin-left: auto; margin-right: auto; }} {{ #if: {{and|{{{desc|}}}|{{{fulldesc|}}}}} | margin-bottom: 0; }} width: {{ #expr: ( {{ #if: {{{width|}}} | {{{width}}} | {{ #if: {{{image5|}}} | 125 | {{ #if: {{{image4|}}} | 150 | {{ #if: {{{image3|}}} | 175 | {{ #if: {{{bigimage|}}} | 100 | 200 }} }} }} }} }} * {{ #if: {{{image5|}}} | 5 | {{ #if: {{{image4|}}} | 4 | {{ #if: {{{image3|}}} | 3 | {{ #if: {{{image2|}}} | 2 | 1 }} }} }} }} ) {{ #if: {{{bigimage|}}} | + 1 }} }}px">
+
{{ #vardefine: $mgt-width | {{ #if: {{{width|}}} | {{{width}}} | {{ #if: {{{image5|}}} | 125 | {{ #if: {{{image4|}}} | 150 | {{ #if: {{{image3|}}} | 175 | {{ #if: {{{bigimage|}}} | 100 | 200 }} }} }} }} }}
 +
}}<table class="wikitable" style="text-align: center; {{ #if: {{{nocenter|}}} || margin-left: auto; margin-right: auto; }} {{ #if: {{and|{{{desc|}}}|{{{fulldesc|}}}}} | margin-bottom: 0; }} width: {{ #expr: ( {{ #var: $mgt-width }} * {{ #if: {{{image5|}}} | 5 | {{ #if: {{{image4|}}} | 4 | {{ #if: {{{image3|}}} | 3 | {{ #if: {{{image2|}}} | 2 | 1 }} }} }} }} ) {{ #if: {{{bigimage|}}} | + 1 }} }}px">
 
  <tr>
 
  <tr>
   <td style="padding: 0;">[[File:{{PAGENAME:{{{image1}}}}}|{{ #if: {{{width|}}} | {{{width}}} | {{ #if: {{{image5|}}} | 125 | {{ #if: {{{image4|}}} | 150 | {{ #if: {{{image3|}}} | 175 | {{ #if: {{{bigimage|}}} | 100 | 200 }} }} }} }} }}px]]</td>{{
+
   <td style="padding: 0;">[[File:{{PAGENAME:{{{image1}}}}}|{{ #var: $mgt-width }}px]]</td>{{
   #if: {{{image2|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image2}}}}}|{{ #if: {{{width|}}} | {{{width}}} | {{ #if: {{{image5|}}} | 125 | {{ #if: {{{image4|}}} | 150 | {{ #if: {{{image3|}}} | 175 | {{ #if: {{{bigimage|}}} | 100 | 200 }} }} }} }} }}px]]</td> }}{{
+
   #if: {{{image2|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image2}}}}}|{{ #var: $mgt-width }}px]]</td> }}{{
   #if: {{{image3|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image3}}}}}|{{ #if: {{{width|}}} | {{{width}}} | {{ #if: {{{image5|}}} | 125 | {{ #if: {{{image4|}}} | 150 | 175 }} }} }}px]]</td> }}{{
+
   #if: {{{image3|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image3}}}}}|{{ #var: $mgt-width }}px]]</td> }}{{
   #if: {{{image4|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image4}}}}}|{{ #if: {{{width|}}} | {{{width}}} | {{ #if: {{{image5|}}} | 125 | 150 }} }}px]]</td> }}{{
+
   #if: {{{image4|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image4}}}}}|{{ #var: $mgt-width }}px]]</td> }}{{
   #if: {{{image5|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image5}}}}}|{{ #if: {{{width|}}} | {{{width}}} | 125 }}px]]</td> }}
+
   #if: {{{image5|}}} | <td style="padding: 0;">[[File:{{PAGENAME:{{{image5}}}}}|{{ #var: $mgt-width }}px]]</td> }}
 
  </tr>{{
 
  </tr>{{
 
   #if: {{{name1|}}}{{{name2|}}}{{{name3|}}}{{{name4|}}}{{{name5|}}}
 
   #if: {{{name1|}}}{{{name2|}}}{{{name3|}}}{{{name4|}}}{{{name5|}}}

Latest revision as of 17:58, 8 June 2024

[[File:|200px]]