No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
* {{Code|sortable}} — if set to {{code|true}} it adds the {{code|sortable}} option to the {{Code|<nowiki><table /></nowiki>}} class. | * {{Code|sortable}} — if set to {{code|true}} it adds the {{code|sortable}} option to the {{Code|<nowiki><table /></nowiki>}} class. | ||
* {{Code|caption}} — adds a table caption. | * {{Code|caption}} — adds a table caption. | ||
** {{Code|edit}} — If {{Code| | ** {{Code|edit}} — If {{Code|caption}} is set, setting edit to any value will use {{Template|Edit}} to add a quick-edit link to the caption. | ||
==Return== | ==Return== | ||
The table starts with {{Code|<nowiki><table class="wikitable"></nowiki>}}, then the supplied parameters are used to construct a {{Code|<nowiki><th /></nowiki>}} with each parameter wrapped in a {{Code|<nowiki><td /></nowiki>}}. | The table starts with {{Code|<nowiki><table class="wikitable"></nowiki>}}, then the supplied parameters are used to construct a {{Code|<nowiki><th /></nowiki>}} with each parameter wrapped in a {{Code|<nowiki><td /></nowiki>}}. | ||
Revision as of 14:13, 10 November 2022
Template:TableTop is used in conjunction with other Table Templates in the creation of properly formatted tables.
Usage
It accepts one mandatory string parameter and up to six additional optional string parameters. All seven are used as entries in the table.
It supports four optional named parameters:
float— controls which side of the content the table appears on,leftorright.sortable— if set totrueit adds thesortableoption to the<table />class.caption— adds a table caption.edit— Ifcaptionis set, setting edit to any value will useTemplate:Editto add a quick-edit link to the caption.
Return
The table starts with <table class="wikitable">, then the supplied parameters are used to construct a <th /> with each parameter wrapped in a <td />.
