Jump to content

Help talk:Collapsing

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Crissov (talk | contribs) at 15:35, 1 March 2010 (→‎Collapsible columns: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconWikipedia Help NA‑class
WikiProject iconThis page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
NAThis page does not require a rating on the project's quality scale.

Layering hide/show

Could the hide/show be layered so that it does not interfere with the centering of the text within the field? Currently the centered text is offset by the hide/show and is driving me batty trying to figure a way around it.

.hide_show_class { z-index:2; }

Something like that might work. - LA @ 15:39, 2 November 2007 (UTC)[reply]

Um

Collapsible tables suck.. why are we going back 10 years to tables when we have a div based solution? --ffroth 12:52, 2 December 2007 (UTC)[reply]

So, what is the div-based solution?

Unformatted text

Is there a way to put pre-formatted content in a collapsible table? 63.118.244.2 (talk) 20:18, 23 December 2009 (UTC)[reply]

"Not accessibility friendly"

What does that mean? Has anyone ever analysed how well screen reader software copes with them, and if people are able to follow them easily and interact with them without sight? Given how frequently these things are used now it seems very important. • Anakin (contribscomplaints) 03:01, 31 December 2007 (UTC)[reply]

I know it's almost a year since the question was posted, but for anyone wondering - some points:
  • If you're using Opera/Firefox/IE8 you can disable CSS to get a rough idea of what screen-readers will "see" - basically the page should be linear, making it easy for the blind and visually impaired to envisage the layout (straight down, top to bottom). Layout tables (used in the code for all of these collapsible examples), disrupt this paradigm, as they are 2 dimensional - navigation is right-to-left as well as top-to-bottom.
  • Also, accessibility is not reserved to the visually impaired. Other physically impaired users may have difficulty with keyboard/mouse usage and may interface with computers in alternate ways. For this reason, normal mouse-navigation cannot be assumed, and the above points about simplifying navigation apply equally here.
lucideer 23:47, 14 November 2008 (UTC) —Preceding unsigned comment added by Lucideer (talkcontribs)

column width?

Is it possible to set individual column widths? - TheMightyQuill (talk) 21:57, 17 March 2008 (UTC)[reply]

show/hide all?

I have a page with dozens of collapsible tables. Is it possible to have a button that expands all or collapses all, in addition to the individual show/hide buttons? —Preceding unsigned comment added by 69.241.122.68 (talk) 20:06, 4 September 2008 (UTC)[reply]

Same question. Anyone know? Calendar (talk) 16:11, 15 September 2008 (UTC)[reply]
Only as a personal userscript (not for everybody else). —AlexSm 16:24, 15 September 2008 (UTC)[reply]
Thanks - care to elaborate? (this is the original poster) —Preceding unsigned comment added by 69.241.122.68 (talk) 19:48, 1 October 2008
The JavaScript code that collapses table was added to this project's global JS file MediaWiki:Common.js. This code is executed for every visitor, so you can use collapsible tables on any page and they will work (except for visitors with JS disabled in their browsers).
On the other hand, you can register and then use your special personal subpage to add some JavaScript code that will be executed just for you (see WP:US for more info). It will not be executed for everybody else, so you won't be able to use this functionality in articles. —AlexSm 20:44, 1 October 2008 (UTC)[reply]
I understand that, but I'm referring to my own private MediaWiki Wiki, not the main MediaWiki site. Is there code that exists so I can have all users expand all tables or collapse all tables on a page, rather than opening and closing individually? —Preceding unsigned comment added by 69.241.122.68 (talk) 13:48, 7 October 2008 (UTC)[reply]

Collapsible Divs?

Does anyone know if it's at all possible to get this effect using elements other than tables? Something along the lines of:

<div>
<a>Show/Hide</a>
<div style="display:none;">
Content
</div>
</div>
lucideer 23:57, 14 November 2008 (UTC) —Preceding unsigned comment added by Lucideer (talkcontribs)

Left-hand side show/hide link ?

I tried to make a table with the show link on the left instead of the right, and this is the best I can manage. Is there a better way, and if so could an example be placed on the help page? Thank you. 84user (talk) 03:05, 18 December 2008 (UTC)[reply]

Code entered Output produced
{| class="wikitable collapsible" style="width:95%;"
! style="position:absolute;text-align:left;width:3em;" |
! style="text-align:left;padding-left:4em" |details
|-
| colspan=2| Lorem ipsum dolor sit amet
Is there a better way to get the same results as
from [[Template:Hidden begin]] with toggle=left?
|}
details
Lorem ipsum dolor sit amet

Is there a better way to get the same results as from Template:Hidden begin with toggle=left?

I managed to switch the show/hide side by editing Common.css (float="left" instead of float="right") but it applies everywhere.70.164.107.205 (talk) 21:24, 10 June 2009 (UTC)[reply]

MediaWiki:Common.js

Where do you find MediaWiki:Common.js, for example local settings in the config folder? please help me. thanks Xxxsacheinxxx (talk) 15:18, 18 February 2009 (UTC)[reply]

> Is it a wiki page. Type it in the search box of your wiki

>> And what if that page does not exist on my wiki? can I just create it? —Preceding unsigned comment added by 203.94.167.153 (talk) 00:50, 23 February 2010 (UTC)[reply]

Dependency with collapsible tables

I only wanted collapsible tables so I only copied the part of Wikipedia's Mediawiki:Common.js relating to that. There is a dependency though in the js for the following function which you also need to copy as well,:

/* Test if an element has a certain class **************************************
 *
 * Description: Uses regular expressions and caching for better performance.
 * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
 */
 
var hasClass = (function () {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
    };
})();

So if it isn;t working for you check that you've got this function in your Mediawiki:common.js

82.35.81.250 (talk) 10:35, 25 February 2009 (UTC)[reply]

Thank you for pointing that out. This should be documented in the help page itself. --Lance E Sloan (talk) 20:39, 2 March 2009 (UTC)[reply]

MediaWiki:Common.js and MediaWiki:Common.css

Besides changes to MediaWiki:Common.js, to implement collapsible tables in your own wiki the same way they are in Wikipedia requires changes to MediaWiki:Common.css as well. It would be nice to have a document of all the changes necessary to implement collapsible tables. --Lance E Sloan (talk) 20:37, 2 March 2009 (UTC)[reply]

I believe that this is the way to do it: http://www.mediawiki.org/wiki/Manual:Collapsible_tables . Place both the CSS and JS at the bottom of the respective CSS and JS, and it should work. --Toussaint (talk) 04:18, 11 March 2009 (UTC)[reply]

Image instead of "Show" / "Hide" Text

I found where in the Javascript to change the text of the show/hide button itself, but I'm looking for a way to invoke an image by URL for the button. How do I go about doing this? Guy.yedwab (talk) 18:08, 9 July 2009 (UTC)[reply]

This page is pretty poorly trafficked, why don't you try Wikipedia:Help desk Agradman talk/contribs

Collapsible columns

Could this feature please be extended to allow the collapsing work on those columns only whose header cell has the class ‘collapsible’ set? This would be useful where tables are too wide and not too high. (I guess someone could also wish to collapse certain rows only or exclude specific rows or columns.) — Christoph Päper 15:35, 1 March 2010 (UTC)[reply]

Test of suggested code

Collapse second column only
Column header 1 Column header 2
Data A1 Data B1
Data A2 Data B2
Collapse second row only
Column header 1 Column header 2
Data A1 Data B1
Data A2 Data B2
Collapse second column and second row, B2 is double-collapsible
Column header 1 Column header 2
Data A1 Data B1
Data A2 Data B2
Do not collapse first column
Column header 1 Column header 2
Data A1 Data B1
Data A2 Data B2