Template:Table/doc: Difference between revisions
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 | |||
|- | |- | ||
| {{ | | style="text-align:center" | {{Code|preset=1|{{param|1}}}} or {{Code|preset=1|{{param|text}}}} | ||
| | | Yout 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"> 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.}} | |||
| | |||
|- | |- | ||
| {{ | | style="text-align:center" | {{Code|preset=1| {{param|th}} }} | ||
| | | {{Template:Deprecated|It will be removed in the future. Use {{tl|link=Th}} instead.}} | ||
| | |||
|- | |- | ||
| {{ | | style="text-align:center" | {{Code|preset=1| {{param|td}} }} | ||
| | | {{Template:Deprecated|It will be removed in the future. Use {{tl|link=Td}} instead.}} | ||
| | |||
|- | |- | ||
| {{ | | 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>}} | |||
|- | |- | ||
| | | 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}} }} | ||
| {{Todo}} | | {{Todo}} | ||
| 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}} }} | ||
| {{Todo}} | | {{Todo}} | ||
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|caption indent:top = 1em}}</nowiki>}} | |||
|- | |- | ||
| {{ | | 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>}} | |||
|- | |- | ||
| {{ | | 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>}} | |||
|- | |- | ||
| | | style="text-align:center" | {{Code|preset=1| {{param|caption indent:left}} }} | ||
| {{Code| | |||
| {{ | |||
| {{Todo}} | | {{Todo}} | ||
| 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. | | 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. | | 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. | | Font size. | ||
| | | style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{Table|font-size = 1.5em}}</nowiki>}} | ||
| | |||
|} | |} | ||
Revision as of 07:23, 12 June 2023

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.
Todo: Make the documentation better.
Parameters
Parameter | Description | Example |
---|---|---|
{{{1}}} or {{{text}}} | Yout text. | |
Tags | ||
{{{tr}}} | ![]() {{Tr}} instead. |
|
{{{th}}} | ![]() {{Th}} instead. |
|
{{{td}}} | ![]() {{Td}} instead. |
|
{{{caption}}} | Table caption (Not available for {{tr}}, {{th}} and {{Table|td}}.). | |
Attributes | ||
{{{id}}} | Element ID. Useful for linking to a specific part of the page. | |
{{{class}}} | Custom HTML class. | |
{{{style}}} | Custom CSS (prepared styles are also planned). | |
Style | ||
{{{caption indent}}} | [Todo] | |
{{{caption indent:top}}} | [Todo] | |
{{{caption indent:right}}} | [Todo] | |
{{{caption indent:bottom}}} | [Todo] | |
{{{caption indent:left}}} | [Todo] | |
{{{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. |
Example
Header 1 | Header 2 | Header 3 |
---|---|---|
Cell 1 | Cell 2 | Cell 3 |
Cell 4 | ||
Cell 6 | Cell 7 |