Template talk:Div col

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

cols[edit]

Hi. Why was cols= marked as deprecated on the template's page? That's an essential function, and it is in no way mutually exclusive with colwidth=. The page says that the two are exclusive, but that's just false. Common sense says they are both complementary and essential. We don't always want everything formatted to unlimited, automatic, arbitrary numbers of columns. It wouldn't make any sense to have 10x2 layout instead of 2x10, for example. Screens will only continue getting bigger, but it still stands as common sense at any size. That's just a basic page layout concept. The "deprecated" marking needs to be removed. Furthermore, div col is generally the best all-purpose column formatting template, and it needs to ultimately subsume some other redundant and generally inferior ones, and I thank everyone who has contributed to it. — Smuckola(talk) 15:49, 6 October 2015 (UTC)

Hello! Please see the § Specifying the maximum number of columns discussion above; IMHO, having that kind of functionality would be very useful. — Dsimic (talk | contribs) 07:37, 7 October 2015 (UTC)

I agree that cols should be restored. Debresser (talk) 23:02, 12 July 2016 (UTC)

Gutter width[edit]

I was about to replace a template:multicol with a div col but couldn't because the multicol specifies a gutter width. That's apparently so the lists won't cause a "clear" after some infoboxes on the right side of the page. This is at German Type IX submarine. Could/should "div col" take a gutter width option? Is there a better way to do this? Kendall-K1 (talk) 20:09, 23 December 2015 (UTC)

Use something like {{div col|style=margin-right:20px;}} --Redrose64 (talk) 13:55, 25 December 2015 (UTC)
That worked, thanks! I do think an explicit param, or documenting this usage, would help those of us who are not css experts and are trying to replace a multicol with gutter param. But I'll admit that's a pretty obscure use case. Kendall-K1 (talk) 14:45, 25 December 2015 (UTC)

colwidth not working properly?[edit]

See Cebu City. In Barangays, North and South should both be 24em. Why aren't they? Or at my wrong? Mary McAllen (talk) 09:28, 6 April 2016 (UTC)

They both have minimum width of 24em. But North has images from the section above to deal with, so there is less overall space for the colunms. -- [[User:Edokter]] {{talk}} 11:00, 6 April 2016 (UTC)
Surely the point of |colwidth= is to fit all columns to keep the width the same, but use fewer columns if necessary. Shouldn't minimum be not used? Mary McAllen (talk) 13:40, 6 April 2016 (UTC)
In fact the two multicol divs are not used in the same margins contexts: there are floatting element in the right, that may extend down to the first div bot not the second div.
To take into account the possible floating elements (the infobox from top of page, using 300px) and the two floatting images (using 250px), you need to set right margins for the divs so that they won't use that space reserved for floating elements.
If you set the same right margin on both divs, their usable content width will be the same, and columns will align. However you used a margin of 25% which is either insufficient (on narrow screens) or too wide (on wide screens): the correct minimum is 300px (the width of the infobox with its border and left margin).
Note that I could compact more the lists using a gap=0 (gaps between columns are not needed for bulleted lists, given that the list already includes a left margin, within which the bullet fits with a minimum indentation, so the bullets cannot touch the column on the left; the bullets and the indentation of items already provides a sufficient gap of separation between columns). Additionally the list items are never longer than 14em, you used 20em for the columns width). verdy_p (talk) 19:33, 31 May 2016 (UTC)

Strange column formatting[edit]

I added this template to Mishkei Herut Beitar and another article (I forget which) and I've noticed that the column lengths don't seem to be coming out properly. This one has six columns with 32 entries and I would expect it to distribute them 6-6-5-5-5-5. However, it actually distributes them 6-5-6-5-6-4. I wondered whether this may be because I was using 15em, but even if I increase if to 20, the distribution comes out as 7-6-7-6-6 as opposed to 7-7-6-6-6. Can anyone advise why this is happening as it doesn't look very good. Cheers, Number 57 10:50, 21 September 2016 (UTC)

On my screen it's 7-7-7-7-4. The layout is handled by your browser. The wiki code just emits css that specifies columns, but your browser places the columns based on how much screen space it thinks it has, and how much space each column takes up, depending on the the size of an "em" in the font you have selected. I agree that your layout is strange, as each entry in the column should have the same height. What browser are you using? Kendall-K1 (talk) 13:59, 21 September 2016 (UTC)
I've tried six different browsers. In five of them (Chrome 49, Firefox 48.0.2, Opera 12.17, Opera 36, Safari 5.1.7), there are 4 columns in Vector skin, 8-8-8-8. But if I switch to MonoBook skin, in Firefox I see 5 columns, 7-7-7-7-4. The sixth browser is Internet Explorer 8, where there is only one column, since it doesn't support columns. --Redrose64 (talk) 21:04, 21 September 2016 (UTC)
@Kendall-K1: I'm on the latest version of Chrome (53). Seeing the same results on two different computers too. Cheers, Number 57 21:56, 21 September 2016 (UTC)
I've come across this issue too. As an example, on the Mister Peabody article the list of episodes of Peabody's Improbable History is divided into 22em columns. At full screen 1920×1200 Firefox and IE11 display 5 columns in a 19-19-19-19-15 format but in Chrome 55 and Opera 42 it displays as 19-18-19-18-17, but perhaps more importantly the lines don't quite line up between the columns. (The difference is small – 1-2px – but it is there.) I also simulated 3840×2400, which gave columns of 9-9-9-9-9-9-9-9-9-9-1 in FF and 10-9-10-9-10-9-10-9-10-5 in Chrome.
I played around with it a bit in Chrome's inspector and found that disabling a margin-bottom: .1em which is applied to lis made the columns render as they do in Firefox (i.e. 19-19-19-19-15, with all the list items aligned properly). I'm not sure how this could be resolved, but it's a start.
P.S. The OS may also be relevant. My tests were done on Win 7.
Alphathon /'æɫ.fə.θɒn(talk) 18:25, 27 December 2016 (UTC)

Default setting[edit]

At present, using this template with no parameters, {{Div col}}, is equivalent to {{Div col |cols=2}}. It seems strange that the default should be a deprecated parameter, so I propose that the default ought to be equivalent to {{Div col |colwidth=30em}} (or 35em, or whatever) in a similar way to how {{reflist}} behaves. Any thoughts on why this wouldn't be an improvement? and what would be the best value for the default minimum column width? --RexxS (talk) 13:47, 23 August 2017 (UTC)