Template:Td/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
 
(One intermediate revision by one other user not shown)
Line 11: Line 11:
| style="text-align:center" | {{Code|preset=1|{{param|1}}}} or {{Code|preset=1|{{param|text}}}}
| style="text-align:center" | {{Code|preset=1|{{param|1}}}} or {{Code|preset=1|{{param|text}}}}
| Your text.
| Your text.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|Hello, World!}}</nowiki>}} {{CodeBlock|<nowiki>{{th|text = Hello, World!}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|Hello, World!}}</nowiki>}} {{CodeBlock|<nowiki>{{td|text = Hello, World!}}</nowiki>}}
|-
|-
| colspan="3" style="background-color:#858585; text-align:center" |
| colspan="3" style="background-color:#858585; text-align:center" |
Line 18: Line 18:
| style="text-align:center" | {{Code|preset=1| {{param|id}} }}
| style="text-align:center" | {{Code|preset=1| {{param|id}} }}
| Element ID. Useful for linking to a specific part of the page.
| Element ID. Useful for linking to a specific part of the page.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|id = my_id}}</nowiki>}} {{CodeBlock|<nowiki>[[My Sweet Page#my_id|My sweet page]]</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|id = my_id}}</nowiki>}} {{CodeBlock|<nowiki>[[My Sweet Page#my_id|My sweet page]]</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|class}} }}
| style="text-align:center" | {{Code|preset=1| {{param|class}} }}
| Custom HTML class.
| Custom HTML class.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|class = myClass}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|class = myClass}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|colspan}} }}
| style="text-align:center" | {{Code|preset=1| {{param|colspan}} }}
| Specifies values for the HTML attribute {{Code|colspan}}.
| Specifies values for the HTML attribute {{Code|colspan}}.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|colspan = 2}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|colspan = 2}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|rowspan}} }}
| style="text-align:center" | {{Code|preset=1| {{param|rowspan}} }}
| Specifies values for the {{Code|rowspan}} HTML attribute.
| Specifies values for the {{Code|rowspan}} HTML attribute.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|rowspan = 4}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|rowspan = 4}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|style}} }}
| style="text-align:center" | {{Code|preset=1| {{param|style}} }}
| Custom CSS (prepared styles are also planned).
| Custom CSS (prepared styles are also planned).
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|style = background-image:linear-gradient(0deg, white, black)}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|style = background-image:linear-gradient(0deg, white, black)}}</nowiki>}}
|-
|-
| colspan="3" style="background-color:#858585; text-align:center" |
| colspan="3" style="background-color:#858585; text-align:center" |
Line 42: Line 42:
| style="text-align:center" | {{Code|preset=1| {{param|width}} }}
| style="text-align:center" | {{Code|preset=1| {{param|width}} }}
| The width of the cell.
| The width of the cell.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|width = 30%}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|width = 30%}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|bgcolor}} }}
| style="text-align:center" | {{Code|preset=1| {{param|bgcolor}} }}
| Background color.
| Background color.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|bgcolor = rgb(255 255 255)}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|bgcolor = rgb(255 255 255)}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|dark}} }}
| style="text-align:center" | {{Code|preset=1| {{param|dark}} }}
| Dark version of the background color.
| Dark version of the background color.
   {{Warning|Overwrites {{Code|preset=1|{{param|bgcolor}}}} and does not allow you to specify a custom background color.}}
   {{Warning|Overwrites {{Code|preset=1|{{param|bgcolor}}}} and does not allow you to specify a custom background color.}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|dark = true}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|dark = true}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{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>{{th|radius = 8px 2px 4px 8px}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|radius = 8px 2px 4px 8px}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|select}} }}
| style="text-align:center" | {{Code|preset=1| {{param|select}} }}
| Specifies the value for the CSS property {{Code|<nowiki>user-select</nowiki>}}.
| Specifies the value for the CSS property {{Code|<nowiki>user-select</nowiki>}}.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|select = all}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|select = all}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|align}} }}
| style="text-align:center" | {{Code|preset=1| {{param|align}} }}
| Text alignment.
| Text alignment.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|align = right}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|align = right}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|font-size}} }}
| style="text-align:center" | {{Code|preset=1| {{param|font-size}} }}
| Font size.
| Font size.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|font-size = 1.5em}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|font-size = 1.5em}}</nowiki>}}
|-
|-
| style="text-align:center" | {{Code|preset=1| {{param|color}} }}
| style="text-align:center" | {{Code|preset=1| {{param|color}} }}
| Text color.
| Text color.
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{th|color = #893GVS}}</nowiki>}}
| style="padding:.2em .5em" | {{CodeBlock|<nowiki>{{td|color = #893GVS}}</nowiki>}}
|}
|}


== See Also ==
== See also ==
* {{tl|link=Table}}
* {{tl|link=Table}}
* {{tl|link=tr}}
* {{tl|link=tr}}

Latest revision as of 23:03, 5 September 2025

Edit-copy.png
This is a documentation subpage for Template:Td.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

A data cell of an HTML table with a prepared style.

Parameters and Examples

Parameter Description Example
{{{1}}} or {{{text}}} Your text.
{{td|Hello, World!}}
{{td|text = Hello, World!}}

Attributes

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

Style

{{{width}}} The width of the cell.
{{td|width = 30%}}
{{{bgcolor}}} Background color.
{{td|bgcolor = rgb(255 255 255)}}
{{{dark}}} Dark version of the background color.
Warning.pngWarning:Overwrites {{{bgcolor}}} and does not allow you to specify a custom background color.
{{td|dark = true}}
{{{radius}}} The radius of the cell border.
{{td|radius = 8px 2px 4px 8px}}
{{{select}}} Specifies the value for the CSS property user-select.
{{td|select = all}}
{{{align}}} Text alignment.
{{td|align = right}}
{{{font-size}}} Font size.
{{td|font-size = 1.5em}}
{{{color}}} Text color.
{{td|color = #893GVS}}

See also