Template:ContentCell/doc: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(category) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This template creates table cells, such as on the Main page. Centralizing them into a template allows for global editing of the style in the template without having to edit multiple locations on a page. <br/> | This template creates table cells, such as on the Main page. Centralizing them into a template allows for global editing of the style in the template without having to edit multiple locations on a page. <br/> | ||
When using the longer parameters, such as a large amount of content, they can be spread across several lines as in example 2. | |||
'' '''NOTE:''' This template | '' '''NOTE:''' This template must be enclosed within braces to create a table as shown.'' | ||
;Example: | ;Example 1: | ||
:<code><nowiki>{| style="width:100%;"</nowiki><br/> | :<code><nowiki>{| style="width:100%;"</nowiki><br/> | ||
:<nowiki>{{ContentCell|70%|title 1|Content 1|title 2|Content 2}}</nowiki><br/> | :<nowiki>{{ContentCell|70%|title 1|Content 1|title 2|Content 2}}</nowiki><br/> | ||
:<nowiki>{{ContentCell||title 1|Content 1|title 2|Content 2}}</nowiki><br/> | :<nowiki>{{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}</nowiki><br/> | ||
:<nowiki>|}</nowiki></code> | :<nowiki>|}</nowiki></code> | ||
;Result: | ;Example 2: | ||
:<code><nowiki>{| style="width:100%;"</nowiki><br/> | |||
:<nowiki>{{ContentCell|70%|title 1|</nowiki><br/> | |||
:<nowiki>Content 1</nowiki> | |||
:<nowiki>|title 2|</nowiki> | |||
:<nowiki>Content 2</nowiki> | |||
:<nowiki>}}</nowiki><br/> | |||
:<nowiki>{{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}</nowiki><br/> | |||
:<nowiki>|}</nowiki></code> | |||
;Both Result In: | |||
<code> | <code> | ||
{| style="width:100%;" | {| style="width:100%;" | ||
{{ContentCell|70%|title 1|Content 1|title 2|Content 2}} | {{ContentCell|70%|title 1|Content 1|title 2|Content 2}} | ||
{{ContentCell||title 1|Content 1|title 2|Content 2}} | {{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}} | ||
|} | |} | ||
</code> | </code> | ||
Line 20: | Line 30: | ||
<br/> | <br/> | ||
<includeonly>[[Category:Templates]]</includeonly> | |||
<noinclude>[[Category:Template documentation]]</noinclude> |
Latest revision as of 20:09, 24 September 2023
This template creates table cells, such as on the Main page. Centralizing them into a template allows for global editing of the style in the template without having to edit multiple locations on a page.
When using the longer parameters, such as a large amount of content, they can be spread across several lines as in example 2.
NOTE: This template must be enclosed within braces to create a table as shown.
- Example 1
{| style="width:100%;"
- {{ContentCell|70%|title 1|Content 1|title 2|Content 2}}
- {{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}
|}
- Example 2
{| style="width:100%;"
- {{ContentCell|70%|title 1|
- Content 1
- |title 2|
- Content 2
- }}
- {{ContentCell||title 1|Content 1|title 2|Content 2|title 3|Content 3}}
|}
- Both Result In
Content 1
Content 2
Content 1
Content 2
Content 3