Search results
Results from the WOW.Com Content Network
Tables use the {| and |} markup, which attributes cannot be added to |}. The markup doesn't directly hold content, so attributes should not be followed by a pipe (|). The syntax for table attributes is: {| attribute="value" attribute2="value2" For example, the "wikitable" class is frequently applied to tables for similar styling.
In general, styles for tables and other block-level elements should be set using CSS classes, not with inline style attributes. This is because the site-wide CSS is more carefully tested to ensure compatibility with a wide range of browsers; it also creates a greater degree of professionalism by ensuring a consistent appearance between articles.
In the first line of table code, after the {|, instead of specifying a style directly, you can also specify a CSS class, which may be used to apply styles. The style for this class can be specified in various ways: in the software itself, per skin (for example the class § sortable)
MediaWiki’s wikitable class (class="wikitable") is designed for straightforward table formatting and enforces certain global styles that make removing borders between adjacent cells challenging even if custom CSS styles attempt to eliminate these borders. Specifically, the class includes:
Tables will show the "[hide]" / "[show]" controls in the first row of the table (whether or not it is a header row), unless a table caption is present.(see § Tables with captions) Example with a header row
This page was last edited on 25 October 2021, at 22:16 (UTC).; Text is available under the Creative Commons Attribution-ShareAlike 4.0 License; additional terms may apply.
inner or innercollapse: Uses the mw-collapsible innercollapse classes to make the table collapsible, but only collapse if the table is within a larger table with the outercollapse class. outer or outercollapse: Uses the outercollapse class to collapse any smaller tables within the table it that use the innercollapse class. Can be combined with ...
See the Width section of Help:Table.To summarize, max-width is the preferred way to limit widths on tables. It works on divs too. Note though that in both tables and divs there needs to be spaces in long lines of text or wikitext.