Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Table
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Class === One or more classes may be added to the [[#Begin and end delimiters|Β§ Begin-table delimiter]] line at the top of the table, and may be used to supply predefined style to the table. The wikicode table {{kbd|class}} attribute [[Help:Basic table markup#How tables are formed|corresponds directly]] to the "{{kbd|class}}" [[HTML attribute|attribute of the HTML]] <code><table></code> element. To add multiple classes to a table, place them all on the same line, embedded in double quotes and separated by a space: <syntaxhighlight lang=wikitext class=grid> {| class="wikitable sortable collapsible" </syntaxhighlight> Some predefined classes are: {| class="wikitable sortable floatright" |+ A sortable wikitable |- ! breed ! ht ! wt |- | Labrador Retriever | 23 | 70 |- | French Bulldog | 12 | 25 |- | German Shepherd | 27 | 78 |- | Golden Retriever | 23 | 71 |- | English Bulldog | 14 | 45 |} * {{kbd|wikitable}} β provides column headers with bold font on shaded background, and other common style. See [[Help:Table/Advanced#Horizontal alignment in cells|here]] for details. This class should be used for almost all tables, unless there is a reason not to. * {{kbd|sortable}} β adds up & down icons to column headers which enable sorting the table on a given column. See [[Help:Sortable tables#Creating sortable tables|sortable tables]]. * {{kbd|mw-collapsible}} β See [[Help:Table/Advanced#Collapsible tables|collapsible tables]].{{efn|group=note|Collapsible tables: the class {{kbd|collapsible}} is available, but no longer recommended; use {{kbd|mw-collapsible}} instead. See [[Help:Table/Advanced#Collapsible tables|here]] for further details.}} * {{kbd|plainrowheaders}} β applies left-aligned and normal-weight formatting of row headers. See [[Wikipedia:Manual of Style/Accessibility/Data tables tutorial#Layout of table headers|Table header layout]]. Must be placed after ''wikitable'' if they both appear in the class declaration. * {{kbd|floatright}} β same as applying <code><nowiki>style="float:right; clear:right; margin-left:8px"</nowiki></code> to the entire table * {{kbd|floatleft}} β same as applying <code><nowiki>style="float:left; clear:left; margin-right:8px"</nowiki></code> to the entire table Note: [[Template:Table]] may also be used to apply classes to the [[#Begin and end delimiters|Β§ Begin-table delimiter]] line.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)