Template:StatTable: Difference between revisions

From I-Pixelmon
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
<includeonly><templatestyles src="Template:StatTable/styles.css"/>
<includeonly><templatestyles src="Template:StatTable/styles.css"/>
<div class="statbox">
<div class="statbox">
   <table style="border-color:{{{frame|#444}}}">
   <table style="border-color:{{{frame|#444}}};">


    <!-- 1. define four columns: auto | bar | range50 | range100 -->
    <colgroup>
      <col class="col-stat"/>
      <col class="col-bar"/>
      <col class="col-range"/>
      <col class="col-range"/>
    </colgroup>
    <!-- 2. headers -->
     <thead>
     <thead>
       <tr>
       <tr>
Line 28: Line 19:
         <td class="lab">HP:<span>{{{HP}}}</span></td>
         <td class="lab">HP:<span>{{{HP}}}</span></td>
         <td class="bar">
         <td class="bar">
           <div class="fill" style="width:{{#expr: ( {{{HP|0}}} * 100 / 255 ) round 0}}%;"></div>
           <div class="fill" style="width:{{#expr: ({{{HP|0}}}*100/255) round 0}}%;"></div>
         </td>
         </td>
         <td class="range">
         <td class="range">
           <small>
           <small>
             {{#ifexpr: {{{HP|1}}} = 1 | 1
             {{#ifexpr: {{{HP}}}=1 | 1
               | {{#expr: ((0 + 2 * {{{HP}}} + (0/4)) * 50 / 100) + 10 + 50}}}}
               | {{#expr: ((0+2*{{{HP}}}+(0/4))*50/100)+10+50}}}}
             –
             –
             {{#ifexpr: {{{HP|1}}} = 1 | 1
             {{#ifexpr: {{{HP}}}=1 | 1
               | {{#expr: ((31 + 2 * {{{HP}}} + (252/4)) * 50 / 100) + 10 + 50}}}}
               | {{#expr: ((31+2*{{{HP}}}+(252/4))*50/100)+10+50}}}}
           </small>
           </small>
         </td>
         </td>
         <td class="range">
         <td class="range">
           <small>
           <small>
             {{#ifexpr: {{{HP|1}}} = 1 | 1
             {{#ifexpr: {{{HP}}}=1 | 1
               | {{#expr: ((0 + 2 * {{{HP}}} + (0/4)) * 100 / 100) + 10 + 100}}}}
               | {{#expr: ((0+2*{{{HP}}}+(0/4))*100/100)+10+100}}}}
             –
             –
             {{#ifexpr: {{{HP|1}}} = 1 | 1
             {{#ifexpr: {{{HP}}}=1 | 1
               | {{#expr: ((31 + 2 * {{{HP}}} + (252/4)) * 100 / 100) + 10 + 100}}}}
               | {{#expr: ((31+2*{{{HP}}}+(252/4))*100/100)+10+100}}}}
           </small>
           </small>
         </td>
         </td>
       </tr>
       </tr>


       <!-- Repeat for Attack, Defense, SpAtk, SpDef, Speed, just swapping names/formulas -->
       <!-- Repeat Attack, Defense, SpAtk, SpDef, Speed in exactly the same 4-cell pattern -->


       <!-- Total row (no bar, collapse last two into footnote/link) -->
       <!-- Total -->
       <tr class="total">
       <tr class="total">
         <td class="lab">Total:<span>{{#expr:  
         <td class="lab">Total:<span>{{#expr:
             {{{HP}}} + {{{Attack}}} + {{{Defense}}} +
             {{{HP}}}+{{{Attack}}}+{{{Defense}}}+
             {{{SpAtk}}} + {{{SpDef}}} + {{{Speed}}}
             {{{SpAtk}}}+{{{SpDef}}}+{{{Speed}}}
           }}</span></td>
           }}</span>
        </td>
         <td class="bar"></td>
         <td class="bar"></td>
        <!-- you can leave these empty or colspan them if you prefer: -->
         <td class="range"></td>
         <td class="range"></td>
         <td class="range"></td>
         <td class="range"></td>

Revision as of 06:11, 19 May 2025


{{StatTable
 |HP=80 |Attack=82 |Defense=83 |SpAtk=100 |SpDef=100 |Speed=80
}}