Template talk:Multicol

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Related template set[edit]

I noticed the mention of this template ({{MultiCol}}) at the Village Pump (section: New_templates_for_creating_multi-column_page_sections.). I created a similar template lacking the ability to take a table width parameter back in August 2005, that being a migration into Wikipedia of a template of the same functionality in Wiktionary that had existed since at least June 2005. See Template talk:Mid4 for more information on this related template set ({{top4}}, {{mid4}}, {{bottom}}). User:Ceyockey (talk to me) 00:06, 12 June 2006 (UTC)

This looks really bad in IE 6. Everything comes out as a collumn of single words. I'm guessing it's a rendering difference issue. Megapixie 01:14, 12 June 2006 (UTC)
That seems to have done the trick. Cheers. Megapixie 03:42, 12 June 2006 (UTC)
Unfortunately, the price I had to pay to make it render in IE6 was to remove the HTML that makes Firefox render all the columns with equal width. So now in both IE6 and Firefox, the column widths are dynamically determined by the browser. I'm desperately looking for a way to force all browsers to render a table with every column having equal width (without explicitly specifying width="25%" for a 4-column table (because my templates can't know how many columns the table will have). Any suggestions? — franl | talk14:16, 12 June 2006 (UTC)
I seem to have fixed this. Now these templates give each column an equal proportion of the available horizontal space (even with IE6). — franl | talk20:28, 12 June 2006 (UTC)

I'll check to see if this template works[edit]

If the tutorial page is still to wide, I'll let you know. There's no sense in having it be 105% --Chuck Marean 23:20, 14 October 2006 (UTC)

  • Yep, 95% solves the problem using this template as well.

http://en.wikipedia.org/w/index.php?title=User:Chuck_Marean/sandbox2&oldid=81552049 -- Chuck Marean 07:36, 15 October 2006 (UTC)

  • I'll now try this:
{{MultiCol|50%}}
 This text appears in the first column.
 {{ColBreak}}
 This text appears in the second column.
 {{ColBreak}}
 This text appears in the third column.
 {{EndMultiCol}}

-- Chuck Marean 07:43, 15 October 2006 (UTC)

  • Yes, {{MultiCol|95%}} works. It's great.

http://en.wikipedia.org/w/index.php?title=User:Chuck_Marean/sandbox2&oldid=81554020 -- Chuck Marean 07:54, 15 October 2006 (UTC)

Adding Multicol to my MediaWiki install[edit]

Fran, I'm new to wiki but am enjoying it greatly. After seeing your templates at work in the Wikipedia tutorial I've tried to add the {{Multicol}}, {{Multicol-break}}, and {{Multicol-end}} templates to my MediaWiki 1.9.3 installation.

Well it wasn't what I thought it was. More exploration is needed. I can enter the template info by hand and get multicolumns working. It's something in the way I've copied the templates I guess -USAAF 18:36, 16 March 2007 (UTC)

Adding multiple Multicols to one page[edit]

OK, I am extremely new to the whole wiki process. I am developing an internal wiki for my company, so it's a learn as I go. This template has been a fantastic help. The only problem I have run into is if I have multiple instances of this on one page.

For example, I have created a page that lists every client we work with. It's a simply alphabetic list with mini table of contents templates to take you to each letter. The A's are long, so I used Multicol and it's beautiful. However, when I added the C's the menu bar to the left of our screen here moved on top of the text! I remove it and it's normal. I even tried making 1 page per letter and using the {{:A}} so the coding isn't in that specific page with the same results. Any ideas?

Desired: style parameter[edit]

I think it would be beneficial to add an optional parameter "style" to this template, following the model at Template:Side box. It is simply added to the end of the style declaration in the Wikitable: - i.e. {| width="{{{1|100%}}}" border="0" cellspacing="0" cellpadding="0" style="background-color:transparent;table-layout:fixed; {{{style|}}}"

The particular value I'd like to send to it is "clear:right;" - to prevent overlap as demonstrated at Template:Multicol/testcases (also Template:Wikisource-multi/testcases section "Cheating"). (I'm still thinking about how to solve the overlap from my end at Wikisource-multi - suggestions welcome).

The article European Union law sends it (in a roundabout way) the value "font-size: 90%;", by encapsulating it in a div specifying the "references-small" class. (if you'd like you could set up font size as another new parameter, but it's scarcely worth the effort) Mike Serfas (talk) 05:13, 1 April 2010 (UTC)

Page width rendering issue if template used within an html div[edit]

I used the template successfully (as many times previous) but placing it within a div with width style parameters meant the div width parameters applied to all subsequent sections, in the whole-page-preview view using IE8 on a PC (not my machine). Adding an extra /div tag after fixed this. I used an html div because couldn't get the multicol width parameter to do anything (this or another list template). See Bactrocera.

I've since sorted the width rendering from the template but I'm still concerned that something unclosed exists in template to need the above fix (see example history before "simplifyfix"). Trev M   14:49, 15 October 2010 (UTC)et seq

Nested list breaking[edit]

This template breaks the nesting of lists. Go to uninhabited islands of the United States lists to see an example. LA (T) @ 23:56, 9 November 2010 (UTC)

Vertical line in middle of gutter[edit]

In many (most?) applications of Multicol, I think a vertical line in the middle of the gutter (except, obviously, the leftmost and rightmost gutters, if any) would aid the eye in separating the columns. Indeed, for someone seeing a section of an article structured as a Multicol for the first time, it may be confusing and not immediately obvious the the information is being presented in columns. Is there a way to add such a vertical line to the template as an option, so as not to break all the existing uses, yet to allow editors the option of specifying it? The place where I would like to use this is Covariance and contravariance of vectors#Definition. David Spector (talk) 15:04, 28 December 2011 (UTC)

Invalid attributes in HTML5[edit]

Could someone update this template to use CSS instead of attributes which are invalid in HTML5? Helder 13:45, 19 June 2013 (UTC)

In Firefox, the rightmost column cluttered with float:right elements[edit]

Two examples: Civil engineering#See also: "List of historic civil engineering landmarks" is mixed with Engineering portal.
Organisation for Economic Co-operation and Development#Foundation of the OECD: (after clicking [show] "Membership 34 countries" in the top infobox) Sweden, Switzerland, Turkey, UK and US are mixed with Economics sidebar. —jisok 17:12, 4 February 2014 (UTC)

Someone recently reverted one of my edits, replacing my {{Multicol}} construct with a {{col-begin}} construct. The person's edit summary stated "fix overlap with infobox in Firefox". Needless to say, I'm not too happy if we need to start worrying about which templates will work with which browsers, especially if the main documentation page for the template gives us no warning. --LukasMatt (talk) 13:15, 24 May 2014 (UTC)

Proposed Edit[edit]

Can this template be edited so that text within it wraps around images and other multimedia objects? See Hempstead, New York#Geography (permalink) for an example of how text within the template doesn't wrap around a multimedia object. Esszet (talk) 01:57, 19 March 2014 (UTC)

Checking... Meteor sandwich yum (talk) 05:39, 19 March 2014 (UTC)
You mean the picture in "Geography" running over into the lists in "Communities"? For me it looks all right.
Or did you mean that the picture couldn't be in "Communities", because it would break the columns? Meteor sandwich yum (talk) 05:46, 19 March 2014 (UTC)
Yes, I do mean that picture. There's a large gap between the ‘Villages’ heading and the beginning of the list in my browser (Safari), so it could be a browser issue. Esszet (talk) 15:05, 19 March 2014 (UTC)
Okay. Sorry, I'll have to field this to someone else. I can't figure out how to fix the issue. Posting at VPT to see if anybody else can figure it. Meteor sandwich yum (talk) 05:00, 21 March 2014 (UTC)
It's browser-dependent; here's what I observe. In Chrome, Internet Explorer 8, Opera and Safari, there is a gap between the heading "Villages" and the start of the list. The bottom of this gap is level with the bottom of the image border. In Firefox, there is no gap, and the bottom of the image occupies some spare space to the right of the list. It can be fixed, as follows: under "Villages", change {{MultiCol}} to {{div col}}; remove the {{ColBreak}}; change the {{EndMultiCol}} to {{div col end}}. This closes up the gap for all browsers, and leaves two columns in all except IE where only one column is displayed. --Redrose64 (talk) 16:21, 21 March 2014 (UTC)
Wikid77 at the VPT said: (permalink)
  • The Template:Multicol should not be used: There are numerous multiple-column templates which create problems on various browsers, and should not be used. Instead just use a plain wp:wikitable "{|...|}" with multiple columns ("|valign=top|"), and any right-side images will cause the column entries to neatly wrap beside images on various browsers. Also, Template:Autocol can be used to wrap around images since it is based on typical "<table>" tag elements. The one restriction with wikitables (or <table>) is to avoid empty columns containing "&nbsp;" as being trouble for screenreaders. -Wikid77 (talk) 16:14, 21 March 2014 (UTC)
Meteor sandwich yum (talk) 22:02, 23 March 2014 (UTC)
See also mw:Making MediaWiki Mobile Friendly and the corresponding thread on wikitech. Helder.wiki 19:08, 24 March 2014 (UTC)
I've alleviated the screenreader problems a bit by setting role=presentation btw —TheDJ (talkcontribs) 20:35, 24 March 2014 (UTC)
TheDJ, what do you think of updating valign="top" to style="vertical-align: text-top;"? Helder.wiki 20:56, 24 March 2014 (UTC)
Helder.wiki, ah I missed that one. thx —TheDJ (talkcontribs) 21:00, 24 March 2014 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── I went with RedRose and replaced {{MultiCol}} with {{Div col}} on Hempstead, New York.

Will consider the slightly more advantageous alternatives, but feeling a bit lazy right now... Meteor sandwich yum (talk) 16:23, 25 March 2014 (UTC)

I came, I saw, I reverted. It looked very odd with {{Autocol}}.
I tried using a table in preview mode, but it didn't really help matters, just complicated the code.
No changes were ultimately made. Meteor sandwich yum (talk) 07:51, 28 March 2014 (UTC)
I don't know much about {{autocol}}, but if you used it in the manner that it is intended to be used, it doesn't just look very odd, it is very odd; and moreover, has horrendous construction giving rise to MOS:ACCESS issues. What you get is a table with one row and two cells in that row. That in itself has problems similar to those of {{multicol}}; but when you look at what goes on inside either of those table cells, the problems just mount up. Consider only the first three items of the left-hand column; the HTML emitted for those is as follows:
<ul>
  <li><a href="/wiki/Atlantic_Beach,_New_York" title="Atlantic Beach, New York">Atlantic Beach</a></li>
</ul>
<p>&#160;&#160;&#160;&#160;&#160;<br /></p>
<ul>
  <li><a href="/wiki/Bellerose,_New_York" title="Bellerose, New York">Bellerose</a></li>
</ul>
<p>&#160;&#160;&#160;&#160;&#160;<br /></p>
<ul>
  <li><a href="/wiki/Cedarhurst,_New_York" title="Cedarhurst, New York">Cedarhurst</a></li>
</ul>
<p>&#160;&#160;&#160;&#160;&#160;<br /></p>
Notice that each list item (the <li>...</li> construct) is immediately followed by a </ul> which closes the list. Then comes a paragraph (the <p>...</p>) containing five non-breaking spaces and a forced line break, the purpose of either of which eludes me. Then comes a <ul> to open the next list ... of just one item. It's like that all the way down - one-item list, empty paragraph, one-item list, empty paragraph, etc. --Redrose64 (talk) 11:14, 28 March 2014 (UTC)
Can this be fixed? There are lists (such as the one here (permalink)) that don't look good with {{Div col}}. Esszet (talk) 13:56, 21 August 2014 (UTC)