Template talk:Columns-list

Request
Hi. First thank you for developing this template. After almost two years searching for an easy columns template on Wikipedia, this is the best hope. Two enhancement requests that would make it usable. Inside list items: Do you think these are possible? —SusanLesch (talk) 23:20, 3 May 2008 (UTC)
 * 1) Allow external links
 * 2) Allow HTML markup
 * I have the same question. At this moment, the template does not allow you to include links that include "=" in the URL, like for example:
 * * http://fotogalerien.ch/index.php?gallery=18&lang=2
 * Can you please fix that? Thanks. —  Ark25  (talk) 11:10, 17 June 2012 (UTC)
 * I found it. You have use before the list the following: "2=". See for example ro:Berna. —  Ark25  (talk) 11:43, 17 June 2012 (UTC)

Browser display
Hi, I would also like to thank you for the template. I'm using it in a personal wiki. The problem i'm facing is that i can see the template working fine in Firefox but it doesn't work in Opera and Explorer. It's very weird right? Any idea why is this happening? --Biris (talk) 12:12, 18 December 2008 (UTC)


 * The template uses CSS to style the columns. It's only supported on Firefox and Safari. Future versions of both Opera and IE should hopefully support it. Chris Cunningham (not at work) - talk 13:22, 18 December 2008 (UTC)

set default to 2
Code in the new sandbox. Sets the default number of columns to be 2, so only one parameter needs to be supplied if one wants two columns. Fully backwards compatible. Chris Cunningham (not at work) - talk 22:08, 10 July 2009 (UTC)
 * Padlock-bronze-slash2.svg Not done: is not required for edits to  unprotected pages, or pending changes protected pages. &mdash; Martin (MSGJ · talk) 06:29, 11 July 2009 (UTC)


 * Cascading protection is on, because this is currently a main page transclusion. Re-enabling. Chris Cunningham (not at work) - talk 11:06, 11 July 2009 (UTC)


 * Padlock-bronze-slash2.svg Not done: is not required for edits to  unprotected pages, or pending changes protected pages. &mdash; Deon555talkI'm  BACK!  03:44, 12 July 2009 (UTC)
 * [[Image:Symbol comment vote.svg|17px]] Note: In saying that, the main page transclusion has ended and thus the template is now unprotected. &mdash; Deon555talkI'm BACK!  03:45, 12 July 2009 (UTC)

merge?
I don't understand exactly what's the use of having this and div col as separate templates; they seem to do the same, but I might be missing something. If I'm right, though, perhaps it would be a good idea to merge them. --Waldir talk 23:54, 12 March 2010 (UTC)
 * Even if they both need to remain due to widespread usage or some such reason, a help article or even just a section section that compares and contrasts the two templates would be very, very welcome. Thanks! Geekdiva (talk) 08:20, 25 January 2011 (UTC)
 * Officially nominated at Templates_for_discussion/Log/2013_March_31. -- Beland (talk) 23:36, 31 March 2013 (UTC)

Width rather than number
Is it possible to make it so that the width can be defined rather than the number of columns? For example instead of the number 2, you can type 30em. The code can probably be copied as-is, with only need to change the div classes, from Reflist.  X  eworlebi (talk) 15:42, 1 February 2011 (UTC)
 * You can use Template:Div col to do this. -- Beland (talk) 23:37, 31 March 2013 (UTC)
 * Or you can use colwidth=30em. Verbcatcher (talk) 17:59, 19 May 2014 (UTC)

Merged with Div col
This template is now (semi-)merged with Div col by formarding all parameters to that template, to avoid duplication of code and functionality. — Edokter  ( talk ) — 12:10, 1 December 2013 (UTC)

Bug report
This template does not show the columnar text, and instead shows the column parameter, if it includes an annotated external link which includes a query string. Example: http://en.wikipedia.org/w/index.php?title=Executive_functions&oldid=616937061#Assessment --195.248.116.49 (talk) 17:29, 14 July 2014 (UTC)
 * correct, if the input has an = sign, you have to either (a) escape the = with  or (b) just use div col instead. Frietjes (talk) 18:49, 14 July 2014 (UTC)
 * Or explicitly number the parameter, . It's not a bug in this template, but a feature that is common to all templates that use positional parameters. -- Red rose64 (talk) 21:03, 14 July 2014 (UTC)

Problem handling empty contents parameter in template:div_col
A user recently reported a problem on the help desk using template:columns-list, which caused Chrome to mis-render the page or go into a loop (and never complete the rendering). See discussion here: Village_pump_(technical)

user:Redrose64 at Village Pump identified the specific problem, that template:div_col, when passed an empty contents= parameter, was defaulting to the "normal" form of template:div_col invocation, and not generating the required  tag. Basically there were a bunch of instances of:

B
• 3

The problem is apparently because while template:columnslist sees a third parameter, and passes that, it's nothing but whitespace, and as such appears missing in div_col. As near as I can tell that making fixing the problem in div_col difficult. Redrose64 suggested altering this template to not invoke div_col when no list content. This is simpler, and I've done it on a test version of this template at user:rwessel/t8. A sample of usage can be seen at user:rwessel/t6 and user:rwessel/t7 (/t7 is a version with enough entries to cause the loop, /t6 just causes the rendering issue).

Anyway, the basic change was simple enough, I wrapped the body of the template in a test for the list being blank. So now it's:

I did an when the list was empty for lack of better ideas. The alternative is to simply do nothing, which might be appropriate for this template.

Which (finally!) leads me to my two questions: First, shold this just generate no (empty) output if the list is blank, or the. And more importantly, I'm a little hesitant to just change a template with 17,000+ transclusions, so if someone can do a bit of a code review, I'd be grateful. Rwessel (talk) 14:53, 25 September 2014 (UTC)
 * Per WP:TESTCASES, please could you put your proposed changes into the template's sandbox. This will make comparisons easier. -- Red rose64 (talk) 15:11, 25 September 2014 (UTC)
 * Done. I also updated the two test pages I had before (user:rwessel/t6 and user:rwessel/t7) to refer to the sandbox, and added "test 5" to the /testcases page.  Rwessel (talk) 15:30, 25 September 2014 (UTC)
 * I removed some newlines. This is because transclusion works by copying the whole template, then removing from to  inclusive, then removing the  and  tags. This means that any whitespace (newlines included) either side of  and  is left alone, as is that outside of .
 * Also, is the red error message necessary? This may cause some pages to suddenly show an error where none had been shown previously; detecting an empty list and showing nothing (failing gracefully) is probably the better option. -- Red rose64 (talk) 16:30, 25 September 2014 (UTC)
 * As I mentioned, I'm not in love with the error message, although if anyone had an empty list before, it would have caused rendering problems. I don't think an empty table would have any meaningful side effects, so rendering such a thing as null should be fine.  Anyway, I've removed it.  Rwessel (talk) 16:37, 25 September 2014 (UTC)


 * I've apparently managed to lose track of this particular issue (Wikipedia really needs something like a to-do list for editors). But assuming there are no objections, I'm going to go ahead an make the above change (I'll give it a few days, just because it has been off the radar for so long).  Rwessel (talk) 04:09, 12 January 2015 (UTC)


 * Let me see if I can simplify it somewhat; I dont like the #ifeq:.  10:23, 12 January 2015 (UTC)
 * Done. Works equally well with just #if:.  10:32, 12 January 2015 (UTC)

make mobile friendly
The column count CSS rules should ideally only apply when the browser width is 768px or above (for tablets and higher). On many mobile devices the lists appear cramped and unreadable. Could we thus add media queries in Common.CSS to make this mobile first so these CSS rules do not apply there or reuse existing the div.columns-2 div.columns-3 etc classes? Jdlrobson (talk) 23:35, 11 January 2015 (UTC)
 * I think this is better discussed at MediaWiki talk:Common.css. This is an old template (and a redirect at that).  00:52, 12 January 2015 (UTC)

with headers
Rencontres d'Arles has rather messy content (much of which looks as if it has been pasted from fr:Wikipedia), but somebody has put some care into the layout. This breaks down at the head of the columnar content of the section titled "Exhibitions". Simply, this starts with a would-be subheading, but the latter is uninterpreted and instead simply rendered as text within sets of equals signs (subsequent headings are rendered as intended). Tips? -- Hoary (talk) 03:06, 6 March 2015 (UTC)
 * I suspect some parsing issue, not identifying the beginning of the line correctly. I've made it a bit better, but there's an excessive gap before the first head.  Rwessel (talk) 03:47, 6 March 2015 (UTC)
 * I've gone ahead and changed the columns to template:multicol. It has fewer parsing problems (actually so does template:div col), and allows the break to be made explicit, which is better for this application.  It would be better if there were a way to specify that a section should not break, but I don't know of such in wikimarkup, so this will need to be managed manually in the future.  Rwessel (talk) 03:58, 6 March 2015 (UTC)
 * Thank you, Rwessel. It's much better now. (Formatting aside, I really ought to attend to that article, but other commitments will prevent this for a month or longer.) -- Hoary (talk) 04:17, 6 March 2015 (UTC)
 * In, a  was added. If instead the two characters   had been added, it would have worked by explicitly numbering the parameter - positional parameters (those not named or explicitly numbered) cannot contain equals signs. -- Red rose64 (talk) 14:34, 6 March 2015 (UTC)
 * Ah, of course. I was thinking it might be something to do with identifying an optional, unnamed, parameter, and I tried explicitly adding the second one, but that didn't do it.  Rwessel (talk) 22:40, 6 March 2015 (UTC)

problem with list of external links
This article Le Monde diplomatique has an excessive list of external links that I tried to get sorted into columns because it's so long, rather than axing it. I tried putting it into three columns but all it does is render the character, "3": see version here. It's a normal asterisked list. Any idea what is going on? Thanks. —Мандичка YO 😜 22:04, 6 April 2015 (UTC)
 * The presence of "=" in the list requires the second parameter to start with "2=". But apart from that, you're better off using div col instead (for which thsi template is just a wrapper). Also, using a fixed number of columns is not advisable.  22:34, 6 April 2015 (UTC)

Comments in the doc
Regarding the comments in Template:Columns-list/doc, [//en.wikipedia.org/wiki/User_talk:Nnemo#Template:Columns-list.2Fdoc a discussion has been started here]. --Nnemo (talk) 09:37, 29 April 2015 (UTC)
 * That is your user talk page, which is not the place to discuss Template:Documentation/preload. The correct place is its own talk page, which is Template talk:Documentation/preload. That redirects to Template talk:Documentation, which is why in I put "please discuss wording at Template talk:Documentation". -- Red rose64 (talk) 09:44, 29 April 2015 (UTC)
 * A discussion about the contents of the template doc page should be *here*, not on a user page. If it continues, or results in some substantive change to the doc page, please move/copy it here.  Rwessel (talk) 09:46, 29 April 2015 (UTC)
 * If it were about the doc page specific to this template, that would be true; but the point being made by and myself is that there are certain components of a doc page which are common to most other doc pages, because newly-created doc pages normally use Template:Documentation/preload as a framework. The wording in /preload is "Categories below this line, please; interwikis at Wikidata"; and Nnemo seems to want to change that wording by a roundabout route, altering one doc page at a time. -- Red rose64 (talk) 15:15, 29 April 2015 (UTC)

Chrome moves link between columns
An issue has been posted to Wikipedia:Help desk#See Also/Unordered List HTML Element Styling issue. PrimeHunter (talk) 20:04, 2 June 2015 (UTC)
 * 🆕 Help desk/Archives/2015 June 2 — Senator2029 “Talk” 05:35, 14 December 2016 (UTC)

Doesn't work
This template doesn't seem to work if the list items aren't pure wikilinks. Please make it compatible with regular text. Jujutsuan ( Please notify with &#123;&#123;re&#125;&#125; talk &#x7C; contribs) 12:59, 29 June 2016 (UTC)
 * Edit: Turns out it's not the non-links, but rather that it apparently can't wrap text to the next line if it goes over roughly 65 characters. When a line is too long it simply displays the second parameter (the number of columns) instead of the content.   Jujutsuan  ( Please notify with &#123;&#123;re&#125;&#125; talk &#x7C; contribs) 13:10, 29 June 2016 (UTC)
 * , do you have some examples?  18:14, 29 June 2016 (UTC)
 * Now it's making a liar out of me. I just tried a dummy list in this message, but it previewed just fine.  I was having trouble over at the "Further reading" section of Evangelical Catholic; I just tried again and it still won't work there.  In the meantime I've switched to using columns there instead, but something's definitely wrong.   Jujutsuan  ( Please notify with &#123;&#123;re&#125;&#125; talk &#x7C; contribs) 08:34, 30 June 2016 (UTC)
 * You have have to use 1 because the list contains "=". otherwise, the list doesn't render. (This applies to all templates with unnamed parameters.)  11:03, 30 June 2016 (UTC)
 * Thank you for your help. That made it work.  Best, — Jujutsuan  ( Please notify with &#123;&#123;re&#125;&#125; talk &#x7C; contribs) 11:17, 30 June 2016 (UTC)

Add gap support
Add gap support as per div col. I already added it to the sandbox so this should just be an update from that. Thank you. 50.53.1.33 (talk) 20:46, 27 December 2016 (UTC)
 * Yes check.svg Done Please update the documentation. —&thinsp;JJMC89&thinsp; (T·C) 21:27, 27 December 2016 (UTC)

Template breaks heading
Christ_myth_theory uses this template and includes ===Headings===, but the first is broken. If I insert a dummy line with text ("fish" whatever) then the heading is OK, but it seems impossible to get an initial heading to work. I tried adding "2=" as the beginning of the text parameter, without any effect. Suggestions? Imaginatorium (talk) 03:34, 12 July 2017 (UTC) {{columns-list|colwidth=15em|&#32;
 * It's to do with lost newlines. This is not a fault in this template specifically, but concerns what happens to whitespace when one templates passes a value onto another template. If you follow through the templates that are used, and, this is what happens. The article has:   (with the middle part of the list omitted for clarity) and this correctly begins with a newline since the   markup (of any level) must be at the start of a line. The  used here expands to   with the newline preserved. However, it's in the content parameter, and named parameters always strip leading and trailing whitespace, which includes newlines, so what gets passed on by  to the next stage is   Notice that the   is not at the start of a line, so it's treated as plain text. What we need to do here is force that first newline to not be stripped, we can do that by hiding it using a harmless character that will be passed through unchanged, yet will be safely ignored by the browser. The ordinary space character will do this, provided that it's encoded either as   or as  , like this:   which of course expands to   and this gives

Christian
... }}
 * Bible conspiracy theory
 * Flower Sermon
 * Now, we have a newline before the  so it's interpreted as heading markup.
 * That 2 didn't work because what it's doing is converting a positional parameter (which doesn't strip whitespace) into a named parameter (which always strips whitespace), which is the opposite of the desired effect. -- Red rose64 &#x1f339; (talk) 08:29, 12 July 2017 (UTC)
 * Thanks!! Imaginatorium (talk) 08:39, 12 July 2017 (UTC)

Deprecated parameter tracking added
I have added a tracking category for articles that still use two unnamed parameters, i.e. one unnamed parameter that used to set the number of columns, and a second unnamed parameter for the content of the list. The first number should be removed entirely or replaced with colwidth if desired. Once the tracking category is fully populated (which will take a few weeks) and then emptied, the unnamed 2 can be removed from this template, along with the tracking category and related notes. – Jonesey95 (talk) 00:18, 14 January 2018 (UTC)
 * All deprecated parameters have been removed in article space. Uses of 2 have been shifted to 1, and the template has been updated to provide an error message if 2 is used. – Jonesey95 (talk) 18:38, 20 July 2018 (UTC)
 * Note: See section below. This change was undone in order to fix usages in all namespaces. Once that was done, the template was updated again to remove support for 2. There is a new error message displayed by the template when 2 is used. – Jonesey95 (talk) 15:48, 26 July 2018 (UTC)

Column break in transcluded list
The column is breaking too early in a transcluded bulleted list, putting about 5% of the list in the first column and 95% in the second column. It is breaking at an outdent from ** to *. Is this expected behaviour? Is there a way to get it to break at roughly the halfway mark, taking into account that as the list is transcluded, its length and indentation may vary over time? Cheers, &middot; &middot; &middot; Peter (Southwood) (talk): 19:25, 2 June 2018 (UTC)

Example:


 * It's not down to this template, I strongly suspect that it's one of those things that varies between browsers. For example, Opera 36 puts the column break immediately after the "Tulagi – Small island north of Guadalcanal in the Solomon Islands" item. Looking more closely, I see that this is directly before the "Wreck sites" item, which is the second item in a list of 2 items. It might be that Opera is counting the number of items in the outermost list (two), dividing that by 2 (giving 1) so once one complete list item has been displayed, it sets a column break. The fact that the two list items are of such different sizes is apparently not taken into account by the browser. -- Red rose64 &#x1f339; (talk) 18:26, 3 June 2018 (UTC)

Template-protected edit request on 20 July 2018
Special:Diff/851196936 seems to have broken the "Recognized content" feature across many WikiProjects, e.g. WikiProject Cryptography/Recognized content. These pages are all updated by (courtesy ping to owner: ), so the bot's code will need to be changed first. Can it be reverted in the meantime? Suffusion of Yellow (talk) 19:04, 20 July 2018 (UTC)
 * Adding: Reverted version added to the sandbox. This seems to fix things. Suffusion of Yellow (talk) 20:38, 20 July 2018 (UTC)
 * Yes check.svg Done., feel free to make your intended change, just please check with to make sure his code is updated first.  « Gonzo fan2007   (talk)  @ 21:48, 20 July 2018 (UTC)


 * The bot removed the column number option last year, but it's still being carried around in a lot of projects' configurations. I've changed it to use  whenever just a number is given (since that is what this template has been outputting no matter how many columns specified). It's running now. It takes awhile to complete (around 10-12 hours), but after that removing the parameter will no longer be an issue for the recognized content pages. -- JLaTondre (talk) 23:43, 20 July 2018 (UTC)
 * The JL-Bot documentation is linking to an example which still uses . That may be part of the reason why so many projects are using the template incorrectly. Suffusion of Yellow (talk) 00:33, 21 July 2018 (UTC)
 * I have removed the limitation in this template that was showing the tracking categories only in article space, since the deprecated parameters are being used in the Wikipedia namespace. I'll wait for the bot to finish its work, then work on fixing the deprecated parameters as they populate the category (if they seem to need to be fixed). Sorry for this inconvenience. – Jonesey95 (talk) 06:13, 21 July 2018 (UTC)
 * Thank you all for your patience. I have fixed instances of the cols (aka 1) parameter in all namespaces and converted the content block in each case to use the first unnamed parameter, 1. I did not edit any pages in the Draft space or any user sandbox or user draft pages. Since moving the content from 2 to 1 will effectively hide the content of the template for all remaining sandbox and Draft pages, I have enabled a red error message that displays when 2 is used. Please let me know if any new problems appear because of this change. – Jonesey95 (talk) 15:47, 26 July 2018 (UTC)

Multiple column templates on a page
I have a user page to which I have been trying to add multiple column templates. However, only the first template actually works. Is this prohibited? If so, it should be mentioned on this template, Div col, and other column templates. Is there a work around for this situation? Thank you for your help. Morriswa (Charlotte Allison) (talk) 08:08, 1 December 2018 (UTC)
 * @Morriswa (Charlotte Allison): I guess you refer to User:Morriswa/Pages I have started/Main and talk namespaces. I have added [//en.wikipedia.org/w/index.php?title=User:Morriswa/Pages_I_have_started/Main_and_talk_namespaces&diff=871487026&oldid=871478033] a missing   in a parameter value and it works now. Mismatched link brackets can cause parameters to not be terminated. PrimeHunter (talk) 11:43, 1 December 2018 (UTC)
 * thank you for correcting that link. I had no idea it was broken. Morriswa (Charlotte Allison) (talk) 01:40, 2 December 2018 (UTC)

Using columns=list in Wikitable
OK guys let me start off by saying I'm a baby user who doesn't know HTML, CSS, or basically any syntax other than what I have picked up, so this is how I have been using this template, and I like that it lets me put column breaks in wherever I want. I am not very familiar with where to post this but thought it might be helpful to someone.

USAGE EXAMPLE:
 * How to Make Columns:


 * The above looks good to me. I see three columns of equal width, with long lines wrapped so that they stay in their columns. If I shrink my window, the effect is maintained. What were you hoping for? Have you tried a different web browser? – Jonesey95 (talk) 16:58, 14 October 2019 (UTC)
 * I edited my original post. It was making columns but since I was using table format I needed to add class="wikitable" for it to work with that syntax. Also to answer your question, I use Chrome. Thanks for the quick feedback! Dsr076 (talk) 22:16, 14 October 2019 (UTC)
 * Now I am confused. A wikitable does not use the columns-list template to make a set of columns. I have removed your "columns-list" text to show that the result is essentially the same. – Jonesey95 (talk) 00:33, 15 October 2019 (UTC)

Backward compatibility and "2"
A) I do not generally support supporting "backward compatibility for non-mainspace". If the template works without it in mainspace, that's good enough. If we need to get a bot to fix the other cases (if those cases are worth supporting, again I don't think they are), then let's do that. B) The reason in the summary is that the parameter would be tracked for use by the 'unknown parameters' module and no pages appear in the category, i.e., the parameter is unused in a meaningful sense. Either way, the removal on my part was related to this work. I don't see a reason for the warning fundamentally. Either the parameter is supported or it's not, and the fact that we're tracking for the parameter in unknown parameters indicates to me that it's not supported. So we should remove it. Otherwise it is essentially permanent 'technical debt'. Izno (talk) 00:19, 23 April 2021 (UTC)


 * And in fact, you acknowledge above that the warning was added solely to warn against new uses. It's been 3 years. I think it's safe to say that it isn't necessary any longer. Izno (talk) 00:20, 23 April 2021 (UTC)
 * I have temporarily removed the article-space limitation on the error check. Let's see what pops up in the category. If nothing of substance appears there, I'm OK with removing support for the parameter entirely. I would rather not silently remove content from pages that use this old feature. – Jonesey95 (talk) 03:31, 23 April 2021 (UTC)
 * Jonesey95, I fixed about 300 pages in that category. I don't think the rest need to be fixed.  Thanks! Plastikspork ―Œ (talk)  15:10, 25 April 2021 (UTC)
 * Agreed. I have restored 's version. Thanks to both of you for engaging in good faith! – Jonesey95 (talk) 17:29, 25 April 2021 (UTC)

Doesn't work in visual editor
This template is not easy to edit in VisualEditor. Are there any alternatives that would work? NemesisAT (talk) 08:47, 8 August 2021 (UTC)
 * Try Div col and div col end. – Jonesey95 (talk) 14:21, 8 August 2021 (UTC)
 * Div col also doesn't offer any improvement, unfortunately. Chitinlink (talk) 15:38, 24 July 2022 (UTC)