Template:Section: Difference between revisions

From Elwiki
mNo edit summary
m (Reverted edits by Ritsu (talk) to last revision by Boxsnake)
Tag: Rollback
 
(187 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly><table cellspacing="0" cellpadding="0" style="width: 100%; padding: 0; margin: 0; font-size: 1em; line-height: 1.5em; word-break: break-all; border: 1px #000 solid; border-bottom: none; border-sapcing: 0;{{{StyleSec|}}}">
__NOTOC__<includeonly><table
   <tr style="font-weight: bold; color: #fff; text-align: center; vertical-align: middle; text-shadow: 1px 1px 1px black; height: 2em; border-bottom: 1px #000 solid;{{{StyleTitle|}}}">{{#if:{{{Title|}}}|
   style="
    <td style="width:{{{Width|}}}; border-left: 1px #000 solid; background-color: {{{Color|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color|}}} 100%);{{{StyleT|}}}">{{{Title|}}}</td>|}}
    {{#if:{{{Widths|}}}|width:{{{Widths|}}};}}
 
    {{{SectionSty|}}}
 
  "
 
  class="
 
    section
 
    {{{SectionCls|}}}
 
  "
 
  {{{Attr|}}}
 
>
{{#if:{{{Title2|}}}|
  <tr
     <td style="width:{{{Width2|}}}; border-bottom: 1px #000 solid; background-color: {{{Color2|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color2|}}} 100%);{{{StyleT2|}}}">{{{Title2|}}}</td>|}}{{#if:{{{Title3|}}}|
    style="{{{hStyles|}}}"
    <td style="width:{{{Width3|}}}; border-bottom: 1px #000 solid; background-color: {{{Color3|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color3|}}} 100%);{{{StyleT3|}}}">{{{Title3|}}}</td>|}}{{#if:{{{Title4|}}}|
     class="
    <td style="width:{{{Width4|}}}; border-bottom: 1px #000 solid; background-color: {{{Color4|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color4|}}} 100%);{{{StyleT4|}}}">{{{Title4|}}}</td>|}}{{#if:{{{Title5|}}}|
      textfloat
    <td style="width:{{{Width5|}}}; border-bottom: 1px #000 solid; background-color: {{{Color5|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color5|}}} 100%);{{{StyleT5|}}}">{{{Title5|}}}</td>|}}{{#if:{{{Title6|}}}|
      {{{hClses|}}}
    <td style="width:{{{Width6|}}}; border-bottom: 1px #000 solid; background-color: {{{Color6|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color6|}}} 100%);{{{StyleT6|}}}">{{{Title6|}}}</td>|}}{{#if:{{{Title7|}}}|
      {{#ifeq:{{{Color|}}}|Rainbow|rainbow}}
    <td style="width:{{{Width7|}}}; border-bottom: 1px #000 solid; background-color: {{{Color7|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color7|}}} 100%);{{{StyleT7|}}}">{{{Title7|}}}</td>|}}{{#if:{{{Title8|}}}|
    ">
    <td style="width:{{{Width8|}}}; border-bottom: 1px #000 solid; background-color: {{{Color8|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color8|}}} 100%);{{{StyleT8|}}}">{{{Title8|}}}</td>|}}{{#if:{{{Title9|}}}|
    {{#forargs:Title
    <td style="width:{{{Width9|}}}; border-bottom: 1px #000 solid; background-color: {{{Color9|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color9|}}} 100%);{{{StyleT9|}}}">{{{Title9|}}}</td>|}}{{#if:{{{Title10|}}}|
      | key
    <td style="width:{{{Width10|}}}; border-bottom: 1px #000 solid; background-color: {{{Color10|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color10|}}} 100%);{{{StyleT10|}}}">{{{Title10|}}}</td>|}}{{#if:{{{Title11|}}}|
      | value
    <td style="width:{{{Width11|}}}; border-bottom: 1px #000 solid; background-color: {{{Color11|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color11|}}} 100%);{{{StyleT11|}}}">{{{Title11|}}}</td>|}}{{#if:{{{Title12|}}}|
      | {{#if:{{#var:value|}}
    <td style="width:{{{Width12|}}}; border-bottom: 1px #000 solid; background-color: {{{Color12|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color12|}}} 100%);{{{StyleT12|}}}">{{{Title12|}}}</td>|}}{{#if:{{{Title13|}}}|
          |<th
    <td style="width:{{{Width13|}}}; border-bottom: 1px #000 solid; background-color: {{{Color13|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color13|}}} 100%);{{{StyleT13|}}}">{{{Title13|}}}</td>|}}{{#if:{{{Title14|}}}|
            style="
    <td style="width:{{{Width14|}}}; border-bottom: 1px #000 solid; background-color: {{{Color14|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color14|}}} 100%);{{{StyleT14|}}}">{{{Title14|}}}</td>|}}{{#if:{{{Title15|}}}|
              {{#if:{{{Width|}}}|width:{{{Width}}};}}
    <td style="width:{{{Width15|}}}; border-bottom: 1px #000 solid; background-color: {{{Color15|}}}; background-image: linear-gradient(to bottom, #eee 0, {{{Color15|}}} 100%);{{{StyleT15|}}}">{{{Title15|}}}</td>|}}
              {{#if:{{{Width{{#var:key|}}|}}}|width:{{{Width{{#var:key|}}}}};}}
              {{#if:{{{Color|}}}|background-color:{{{Color}}};}}
              {{#if:{{{Color{{#var:key|}}|}}}|background-color:{{{Color{{#var:key|}}}}};}}
              {{{hStyle|}}};
              {{{hStyle{{#var:key|}}|}}}
            "
            class="
              {{{hCls{{#var:key|}}|{{{hCls|}}}}}}
              {{#ifeq:{{{Color{{#var:key|}}|}}}|Rainbow|rainbow}}
            "
            {{{hAttr{{#var:key|}}|{{{hAttr|}}}}}}
          ><!--
            -->{{#if:{{{header|}}}
              |<h{{{header|}}} id="{{anchorencode:{{#var:value|}}}}">{{#var:value|}}</h{{{header|}}}>
              |{{#var:value|}}
            }}<!--
          --></th>
        }}
    }}
   </tr>
   </tr>
   <tr style="{{{StyleContent|}}}>
   <tr
     <td style="padding: 0.5em;{{{Style|}}}">{{{Content|}}}</td>{{#if:{{{Title1|}}}|
     style="{{{Styles|}}}"
     <td style="padding: 0.5em;{{{Style1|}}}">{{{Content1|}}}</td>|}}{{#if:{{{Title2|}}}|
     class="{{{Clses|}}}"
    <td style="padding: 0.5em;{{{Style2|}}}">{{{Content2|}}}</td>|}}{{#if:{{{Title3|}}}|
  >
    <td style="padding: 0.5em;{{{Style3|}}}">{{{Content3|}}}</td>|}}{{#if:{{{Title4|}}}|
    {{#forargs:Title
    <td style="padding: 0.5em;{{{Style4|}}}">{{{Content4|}}}</td>|}}{{#if:{{{Title5|}}}|
      | key
    <td style="padding: 0.5em;{{{Style5|}}}">{{{Content5|}}}</td>|}}{{#if:{{{Title6|}}}|
      | value
    <td style="padding: 0.5em;{{{Style6|}}}">{{{Content6|}}}</td>|}}{{#if:{{{Title7|}}}|
      | {{#if:{{#var:value|}}
    <td style="padding: 0.5em;{{{Style7|}}}">{{{Content7|}}}</td>|}}{{#if:{{{Title8|}}}|
          |<td
    <td style="padding: 0.5em;{{{Style8|}}}">{{{Content8|}}}</td>|}}{{#if:{{{Title9|}}}|
            style="
    <td style="padding: 0.5em;{{{Style9|}}}">{{{Content9|}}}</td>|}}{{#if:{{{Title10|}}}|
              {{#if:{{{Width|}}}|width:{{{Width}}};}}
    <td style="padding: 0.5em;{{{Style10|}}}">{{{Content10|}}}</td>|}}{{#if:{{{Title11|}}}|
              {{#if:{{{Width{{#var:key|}}|}}}|width:{{{Width{{#var:key|}}}}};}}
    <td style="padding: 0.5em;{{{Style11|}}}">{{{Content11|}}}</td>|}}{{#if:{{{Title12|}}}|
              {{{Style|}}};
    <td style="padding: 0.5em;{{{Style12|}}}">{{{Content12|}}}</td>|}}{{#if:{{{Title13|}}}|
              {{{Style{{#var:key|}}|}}}
    <td style="padding: 0.5em;{{{Style13|}}}">{{{Content13|}}}</td>|}}{{#if:{{{Title14|}}}|
            "
    <td style="padding: 0.5em;{{{Style14|}}}">{{{Content14|}}}</td>|}}{{#if:{{{Title15|}}}|
            class="{{{Cls{{#var:key|}}|{{{Cls|}}}}}}"
     <td style="padding: 0.5em;{{{Style15|}}}">{{{Content15|}}}</td>|}}
            {{{Attr{{#var:key|}}|{{{Attr|}}}}}}
          ><!--
            -->{{{Content{{#var:key|}}|}}}<!--
          --></td>
        }}
     }}
   </tr>
   </tr>
</table></includeonly>
</table><includeonly><noinclude>{{Doc}}</noinclude>
__TOC__
== Section模板 ==
Section模板是由[[User:boxsnake|boxsnake]]编写的UI模板,旨在美化界面。
== 模板参数 ==
*'''什么是模板参数?'''
模板参数可以看做是传入模板的变量,由模板接受后填入对应的代码位置,一般为'''''<nowiki>参数名=参数值</nowiki>'''或者'''或者'''''参数值'''''。如果用前者方式传入模板,模板通过变量名调用变量的值(比如'''''a=2''''',那么模板调用a就会显示2),后者传入模板的话,模板根据传入值的序列用序列号调用(第一个序号为1,第二个为2,依次类推)。
*'''我如何传入模板参数?'''
<nowiki>{{模板名
| 参数1
| 参数名2=参数值2
}}</nowiki>
 
模板参数使用“|”分割。
=== 整体参数 ===
==== StyleSec ====
*此参数用于为整个Section框架增加样式,样式写法兼容CSS语句。并且,此样式会覆盖之前已有的同名样式。
'''示例:'''<br>
<nowiki>{{Section
| StyleSec=border-radius: 10px;
}}</nowiki>
{{Section
| StyleSec=border-radius: 10px;
| Title1=s
| Title2=
}}
可以看到,整个表格出现了圆角。
==== StyleTitle ====
*此参数用于为整个Section表头增加样式,样式写法兼容CSS语句。并且,此样式会覆盖之前已有的同名样式。
'''示例:'''<br>
<nowiki>{{Section
| StyleTitle=border-bottom: 2px dashed red;
}}</nowiki>
{{Section
| StyleSec=
}}
可以看到,表头下方的划线整个表格出现了圆角
==== Title ====
*此参数用于为整个Section框架增加样式,样式写法兼容CSS语句。并且,此样式会覆盖之前已有的同名样式。
=== 个体参数 ===
=== 其他 ===

Latest revision as of 11:59, 2 May 2022