Template:Table/doc: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (typo fix) |
||
(19 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Doc/subpage}} | {{Doc/subpage}} | ||
Adds a table, but actually adds a table. | Adds a table, but actually adds a table. | ||
{{ | == Parameters and Examples == | ||
< | {| class="standard-table" style="width:100%" | ||
|- style="position:sticky; z-index:10; top:0" | |||
! style="width:17em" | Parameter | |||
! Description | |||
! Example | |||
|- | |||
| style="text-align:center" | {{Code|preset=1|{{param|1}}}} or {{Code|preset=1|{{param|text}}}} | |||
| Your text. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|Hello, World!}}</nowiki>}} {{CodeBlock|<nowiki>{{Table|text = Hello, World!}}</nowiki>}} | |||
|- | |||
| colspan="3" style="background-color:#858585; text-align:center" | | |||
==== <span style="color:#000"> Elements </span> ==== | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|caption}} }} | |||
| Table caption. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption = Hello, World!}}</nowiki>}} | |||
|- | |||
| colspan="3" style="background-color:#858585; text-align:center" | | |||
== | ==== <span style="color:#000"> Attributes </span> ==== | ||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|id}} }} | |||
| Element ID. Useful for linking to a specific part of the page. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|id = my_id}}</nowiki>}} {{CodeBlock|<nowiki>[[My Sweet Page#my_id|My sweet page]]</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|class}} }} | |||
| Custom HTML class. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|class = myClass}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|style}} }} | |||
| Custom CSS. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|style = background-image:linear-gradient(0deg, white, black)}}</nowiki>}} | |||
|- | |||
| colspan="3" style="background-color:#858585; text-align:center" | | |||
==== <span style="color:#000"> Style </span> ==== | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|caption indent}} }} | |||
| Indentation of the caption from all sides. | |||
* {{ | | style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent = 1em 2em 3em 4em}}</nowiki>}} | ||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:top}} }} | |||
| Indentation of the caption at the top | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:top = 1em}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:right}} }} | |||
| Indentation of the caption on the right. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:right = 2em}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:bottom}} }} | |||
| Indentation of the caption at the bottom. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:bottom = 3em}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:left}} }} | |||
| Indentation of the caption on the left. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:left = 4em}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|width}} }} | |||
| The width of the cell. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|width = 30%}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|bgcolor}} }} | |||
| Background color. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|bgcolor = rgb(255 255 255)}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|radius}} }} | |||
| The radius of the cell border. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|radius = 8px 2px 4px 8px}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|align}} }} | |||
| Table alignment. Available values: | |||
* {{Code|<nowiki>center</nowiki>}} | |||
* {{Code|<nowiki>right</nowiki>}} | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|align = right}}</nowiki>}} | |||
|- | |||
| style="text-align:center" | {{Code|preset=1| {{param|font-size}} }} | |||
| Font size. | |||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|font-size = 1.5em}}</nowiki>}} | |||
|} | |||
== Ready-made table code == | |||
{{CodeBlock|<nowiki>{{Table | {{CodeBlock|<nowiki>{{Table | ||
| align = center | | align = center | ||
| caption = <span style="user-select:none"> [[File:ValveEmployee.png|link = Valve]] </span> | | caption = <span style="user-select:none"> [[File:ValveEmployee.png|link = Valve]] </span> | ||
| caption | | caption indent:bottom = 1em | ||
| {{ | | {{tr | ||
| {{ | | {{th|radius=3px 0 0 0| Header 1 }} | ||
{{th| Header 2 }} | |||
{{th|radius=0 3px 0 0| Header 3 }} | |||
}} | }} | ||
{{ | {{tr | ||
| {{ | | {{td| Cell 1 }} | ||
{{td| Cell 2 }} | |||
{{td|rowspan=2| Cell 3 }} | |||
}} | }} | ||
{{ | {{tr | ||
| {{ | | {{td|colspan=2|bgcolor=#303030| Cell 4 }} | ||
}} | }} | ||
{{ | {{tr | ||
| {{ | | {{td|radius=0 0 0 3px| Cell 6 }} | ||
{{td|colspan=2|bgcolor=#303030|radius=0 0 3px 0| Cell 7 }} | |||
}} | }} | ||
}}</nowiki>}} | }}</nowiki>}} | ||
{{Table | {{Table | ||
| id = example_table | |||
| align = center | | align = center | ||
| caption = <span style="user-select:none"> [[File: | | caption = <span style="user-select:none"> [[File:Valve icon.png|link = Valve]] </span> | ||
| caption | | caption indent:bottom = 1em | ||
| {{ | | {{tr | ||
| {{th|radius=3px 0 0 0| Header 1 }} | |||
| {{ | {{th| Header 2 }} | ||
{{th|radius=0 3px 0 0| Header 3 }} | |||
}} | }} | ||
{{ | {{tr | ||
| {{ | | {{td| Cell 1 }} {{td| Cell 2 }} | ||
{{td|rowspan=2| Cell 3 }} | |||
}} | }} | ||
{{ | {{tr | ||
| {{ | | {{td|colspan=2|bgcolor=#303030| Cell 4 }} | ||
}} | }} | ||
{{ | {{tr | ||
| {{ | | {{td|radius=0 0 0 3px| Cell 6 }} | ||
{{td|colspan=2|bgcolor=#303030|radius=0 0 3px 0| Cell 7 }} | |||
}} | }} | ||
}} | }} |
Latest revision as of 15:27, 4 August 2025

This is a documentation subpage for Template:Table.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Don't forget to purge the contents of the base page upon creating or editing this subpage.
Adds a table, but actually adds a table.
Parameters and Examples
Parameter | Description | Example |
---|---|---|
{{{1}}} or {{{text}}} | Your text. | |
Elements | ||
{{{caption}}} | Table caption. | |
Attributes | ||
{{{id}}} | Element ID. Useful for linking to a specific part of the page. | |
{{{class}}} | Custom HTML class. | |
{{{style}}} | Custom CSS. | |
Style | ||
{{{caption indent}}} | Indentation of the caption from all sides. | |
{{{caption indent:top}}} | Indentation of the caption at the top | |
{{{caption indent:right}}} | Indentation of the caption on the right. | |
{{{caption indent:bottom}}} | Indentation of the caption at the bottom. | |
{{{caption indent:left}}} | Indentation of the caption on the left. | |
{{{width}}} | The width of the cell. | |
{{{bgcolor}}} | Background color. | |
{{{radius}}} | The radius of the cell border. | |
{{{align}}} | Table alignment. Available values:
|
|
{{{font-size}}} | Font size. |
Ready-made table code
Header 1 | Header 2 | Header 3 |
---|---|---|
Cell 1 | Cell 2 | Cell 3 |
Cell 4 | ||
Cell 6 | Cell 7 |