Template:Table/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 8: Line 8:
{| class="standard-table" style="width:100%"
{| class="standard-table" style="width:100%"
|- style="position:sticky; z-index:10; top:0"
|- style="position:sticky; z-index:10; top:0"
! Parameter
! style="width:17em" | Parameter
! Description
! Description
! Example
|-
|-
| {{Param|id}}
| style="text-align:center" | {{Code|preset=1|{{param|1}}}} or {{Code|preset=1|{{param|text}}}}
| Element ID for links.
| Yout text.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|Hello, World!}}</nowiki>}} {{CodeBlock|<nowiki>{{Table|text = Hello, World!}}</nowiki>}}
|-
|-
| {{Param|class}}
| colspan="3" style="background-color:#858585; text-align:center" |
| Custom HTML class.
==== <span style="color:#000"> Tags </span> ====
|-
| style="text-align:center" | {{Code|preset=1| {{param|tr}} }}
| {{Template:Deprecated|It will be removed in the future. Use {{tl|link=Tr}} instead.}}
|
|-
|-
| {{Param|style}}
| style="text-align:center" | {{Code|preset=1| {{param|th}} }}
| Custom CSS (prepared styles are also planned).
| {{Template:Deprecated|It will be removed in the future. Use {{tl|link=Th}} instead.}}
|
|-
|-
| {{Param|width}}
| style="text-align:center" | {{Code|preset=1| {{param|td}} }}
| Element width.
| {{Template:Deprecated|It will be removed in the future. Use {{tl|link=Td}} instead.}}
|
|-
|-
| {{Param|caption}}
| style="text-align:center" | {{Code|preset=1| {{param|caption}} }}
| Table caption (Not available for {{Code|<nowiki>{{tr}}</nowiki>}}, {{Code|<nowiki>{{th}}</nowiki>}} and {{Code|<nowiki>{{Table|td}}</nowiki>}}.).
| Table caption (Not available for {{Code|<nowiki>{{tr}}</nowiki>}}, {{Code|<nowiki>{{th}}</nowiki>}} and {{Code|<nowiki>{{Table|td}}</nowiki>}}.).
| 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 (prepared styles are also planned).
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|style = background-image:linear-gradient(0deg, white, black)}}</nowiki>}}
|-
|-
| {{Param|caption indent}}
| colspan="3" style="background-color:#858585; text-align:center" |
| {{Todo}}
==== <span style="color:#000"> Style </span> ====
|-
|-
| {{Param|caption indent:top}}
| style="text-align:center" | {{Code|preset=1| {{param|caption indent}} }}
| {{Todo}}
| {{Todo}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent = 1em 2em 3em 4em}}</nowiki>}}
|-
|-
| {{Param|caption indent:right}}
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:top}} }}
| {{Todo}}
| {{Todo}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:top = 1em}}</nowiki>}}
|-
|-
| {{Param|caption indent:bottom}}
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:right}} }}
| {{Todo}}
| {{Todo}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:right = 2em}}</nowiki>}}
|-
|-
| {{Param|caption indent:left}}
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:bottom}} }}
| {{Todo}}
| {{Todo}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:bottom = 3em}}</nowiki>}}
|-
|-
| {{Param|tr}}
| style="text-align:center" | {{Code|preset=1| {{param|caption indent:left}} }}
| {{Code|&#60;tr>&#60;/tr>}}
|-
| {{Param|th}}
| {{Code|&#60;th>&#60;/th>}}
|-
| {{Param|td}}
| {{Code|&#60;td>&#60;/td>}}
|-
| {{Param|colspan}}
| {{Todo}}
| {{Todo}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:left = 4em}}</nowiki>}}
|-
|-
| {{Param|cellpadding}}
| style="text-align:center" | {{Code|preset=1| {{param|width}} }}
| {{Todo}}
| The width of the cell.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|width = 30%}}</nowiki>}}
|-
|-
| {{Param|bgcolor}}
| style="text-align:center" | {{Code|preset=1| {{param|bgcolor}} }}
| Background color.
| Background color.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|bgcolor = rgb(255 255 255)}}</nowiki>}}
|-
|-
| {{Param|radius}}
| style="text-align:center" | {{Code|preset=1| {{param|radius}} }}
| The radius of the cell border.
| The radius of the cell border.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|radius = 8px 2px 4px 8px}}</nowiki>}}
|-
|-
| {{Param|font-size}}
| 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.
| Font size.
|-
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|font-size = 1.5em}}</nowiki>}}
| {{Param|color}}
| Color of the text.
|-
| {{Param|align}}
| Alignment of a table or text.
|-
| {{Param|sticky}}
| Makes {{Code|<nowiki>{{tr}}</nowiki>}} stick to the top of the screen.
|}
|}



Revision as of 07:23, 12 June 2023

Edit-copy.png
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.

Adds a table, but actually adds a table.

Template:ModernNote

Todo: Make the documentation better.

Parameters

Parameter Description Example
{{{1}}} or {{{text}}} Yout text.
{{Table|Hello, World!}}
{{Table|text = Hello, World!}}

Tags

{{{tr}}}
Obsolete-notext.pngDeprecated:It will be removed in the future. Use {{Tr}} instead.
{{{th}}}
Obsolete-notext.pngDeprecated:It will be removed in the future. Use {{Th}} instead.
{{{td}}}
Obsolete-notext.pngDeprecated:It will be removed in the future. Use {{Td}} instead.
{{{caption}}} Table caption (Not available for {{tr}}, {{th}} and {{Table|td}}.).
{{Table|caption = Hello, World!}}

Attributes

{{{id}}} Element ID. Useful for linking to a specific part of the page.
{{Table|id = my_id}}
[[My Sweet Page#my_id|My sweet page]]
{{{class}}} Custom HTML class.
{{Table|class = myClass}}
{{{style}}} Custom CSS (prepared styles are also planned).
{{Table|style = background-image:linear-gradient(0deg, white, black)}}

Style

{{{caption indent}}} [Todo]
{{Table|caption indent = 1em 2em 3em 4em}}
{{{caption indent:top}}} [Todo]
{{Table|caption indent:top = 1em}}
{{{caption indent:right}}} [Todo]
{{Table|caption indent:right = 2em}}
{{{caption indent:bottom}}} [Todo]
{{Table|caption indent:bottom = 3em}}
{{{caption indent:left}}} [Todo]
{{Table|caption indent:left = 4em}}
{{{width}}} The width of the cell.
{{Table|width = 30%}}
{{{bgcolor}}} Background color.
{{Table|bgcolor = rgb(255 255 255)}}
{{{radius}}} The radius of the cell border.
{{Table|radius = 8px 2px 4px 8px}}
{{{align}}} Table alignment. Available values:
  • center
  • right
{{Table|align = right}}
{{{font-size}}} Font size.
{{Table|font-size = 1.5em}}

Example

{{Table | align = center | caption = <span style="user-select:none"> [[File:ValveEmployee.png|link = Valve]] </span> | 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 }} }} }}