Content deleted Content added
Timeshifter (talk | contribs) →Horizontal scrolling table: see also |
→Collapsible tables: move {{shortcut}} up (as it redirects to the entire section rather than an anchor within it) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 677:
== Collapsible tables ==
{{see also|Help:Collapsing#Collapsible tables|mw:Manual:Collapsible elements}}
{{shortcut|WP:TABLECOLLAPSE}}▼
Classes can also be used to collapse tables, so they are hidden by default. Use the class {{nowrap|<code>mw-collapsible</code>}} to enable collapsing behaviour. Collapsible tables can be sortable, too, by also including the <code>sortable</code> class {{See below|{{section link||Sortable tables}}}}. By default, a collapsible table begins expanded. To change this, add the additional class {{nowrap|<code>mw-collapsed</code>}}. Alternatively, you can add <code>autocollapse</code>, instead of {{nowrap|<code>mw-collapsed</code>}}, which will automatically collapse the table if two or more collapsible elements are present on the page.
Line 769 ⟶ 770:
</syntaxhighlight></div>
<div style="display:inline-table; border: 2px solid lime; padding: 0.5em;">
'''Rendered result.<br>Click "hide" to
----
{| class="wikitable mw-collapsible"
Line 782 ⟶ 783:
</div>
<div style="display:inline-table; border: 2px solid lime; padding: 0.5em;">
'''Rendered result<br>(without <nowiki>{{nowrap}}</nowiki>.<br>Click "hide" to
----
{| class="wikitable mw-collapsible"
Line 811 ⟶ 812:
</syntaxhighlight></div>
<div style="display:inline-table; border: 2px solid lime; padding: 0.5em;">
'''Rendered result.<br>Click "
----
{| class="wikitable mw-collapsible mw-collapsed"
Line 824 ⟶ 825:
</div>
<div style="display:inline-table; border: 2px solid lime; padding: 0.5em;">
'''Rendered result<br>(without <nowiki>{{nowrap}}</nowiki>.<br>Click "
----
{| class="wikitable mw-collapsible mw-collapsed"
Line 839 ⟶ 840:
'''Sorting and collapsing'''
▲{{shortcut|WP:TABLECOLLAPSE}}
It is possible to collapse a sortable table. To do so, you need to use this code:
:<code>'''class="wikitable sortable mw-collapsible"'''</code>
Line 991:
In dark mode in article namespace table cells with background colors have black underlined links. For example:
*[[List of top-division football clubs in UEFA countries#Spain]] - scroll down a little to the table.
So any cell with [[WCAG]]-acceptable link color contrast in light mode has even better link color contrast in dark mode.
{{tracked|T376931}}
Line 1,004:
There are many off-wiki tables with useful coloring that meet [[WCAG]] access standards. Currently, there does not seem to be a way to copy those tables to a wiki and keep styling such as colors (background or text color). It is possible to convert PDF tables to Excel and keep the colors. Or to HTML tables and keep the colors. But there does not seem to be a way to copy any of those colored tables (PDF, Excel, HTML, etc.) to a wiki. If there is a way, please leave a note on [[Help talk:Table]].
If desired one can keep the coloring by copying the table as an image. This may be necessary for frequently updated colored tables where it would be too time consuming to add color to many cells after each update. There is no problem with copyright for most data tables, colored or not. They are in the public ___domain. See [[Commons:Template:PD-chart]]. Go here for more info:
*[[Help:Table#Public ___domain image tables]]
== Other table syntax ==
Line 1,114 ⟶ 1,115:
== See also ==
*[[Help:Table]] for general information about using tables. It also has many links in
{{Help navigation}}
|