Template talk:Div col
| Template:Div col is permanently protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
| This is the talk page for discussing improvements to the Div col template. |
|
| Archives: 1Auto-archiving period: 3 months |
Dynamic column width instead of fixed width
[edit]Is it possible for the column width to be specified as a percentage of the available table or page width? For example, {{Graphic novel list}} renders whitespace in |ChapterListCol2= if it doesn't span the same number of rows as |ChapterListCol1=; see List of Monogatari novels for several examples of this whitespace. I have previewed listing the chapters using |colwidth=50% and |colwidth=40%, but it rendered the columns at 30em. — Jkudlick ⚓ (talk) 01:45, 21 August 2024 (UTC)
- Percentage is not an absolute or relative length unit. Try
|colwidth=40vwor a similar number between 10 and 50. That says "columns should be 40% of their container's width". Test it by making your window wider and less wide. It works on the template's testcases page. – Jonesey95 (talk) 04:17, 21 August 2024 (UTC)- Thank you. Perhaps the variable width should be added to the documentation? — Jkudlick ⚓ (talk) 19:48, 23 August 2024 (UTC)
- Seconded. —DocWatson42 (talk) 04:36, 25 November 2024 (UTC)
- You don't have to second anything. See Template:Div col#Examples. – Jonesey95 (talk) 04:57, 25 November 2024 (UTC)
- Oh, well. There had been no reply, so I assumed that it had not been done. —DocWatson42 (talk) 05:03, 25 November 2024 (UTC)
- You don't have to second anything. See Template:Div col#Examples. – Jonesey95 (talk) 04:57, 25 November 2024 (UTC)
- Seconded. —DocWatson42 (talk) 04:36, 25 November 2024 (UTC)
- Thank you. Perhaps the variable width should be added to the documentation? — Jkudlick ⚓ (talk) 19:48, 23 August 2024 (UTC)
- This sounds like an attempt to circumvent the cunsensus arrived at on this talk page to remove the
|cols=parameter, which was actioned more than six years ago. See Template talk:Div col/Archive 1#1= and 2= and cols= no longer supported. --Redrose64 🌹 (talk) 19:00, 25 November 2024 (UTC)- The reason that was removed was because the implementations of columns was not particularly good at the time. I've been considering a discussion to reintroduce some sort of
|max-columns=parameter, which would use the already-existing|colwidth=(or default) and then set the column count on top of that. When both width and count are provided, CSS columns treat the column count as a maximum rather than a required number of columns. The primary issue with columns before was that they were being set without the column width, which treated them as the required count, which is the general problem child especially on low resolutions. Izno (talk) 03:12, 22 May 2025 (UTC)
- The reason that was removed was because the implementations of columns was not particularly good at the time. I've been considering a discussion to reintroduce some sort of
Template-protected edit request on 19 September 2024
[edit]This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Please inclde these names under Notable teachers
- Graham Hair, composition
- Bozidar Kos, composition
- Trevor Pearce, composition
- Greg Schiemer, composition and electronic music
- Michael Smetanin, composition
- Richard Vella, composition
- Martin Wesley-Smith, composition and electronic music
- Gillian Whitehead, composition Greg Schiemer (talk) 12:41, 19 September 2024 (UTC)
Not done: this is the talk page for discussing improvements to the template {{Div col}}. Please make your request at the talk page for the article concerned. Sohom (talk) 13:08, 19 September 2024 (UTC)
Horizontal sorting
[edit]Is it possible to get sorting of a list like so:
- Consul
- Praetor
- Aedile
- Quaestor
Instead to present as
Consul Praetor Aedile Quaestor
Ifly6 (talk) 01:00, 18 February 2025 (UTC)
- Are you talking about sorting or transposition? Because that sort of looks like the latter, although maybe it is just an artefact of being a 2 x 2 example. Another before & after example might help, this time with a 4-row, 3-column table. Mathglot (talk) 08:58, 18 February 2025 (UTC)
(outdent) I suppose then, with 12 items:
1 2 3 4 5 6 7 8 9 10 11 12
Using {{div col}} right now it would display as
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
Ifly6 (talk) 14:22, 18 February 2025 (UTC)
- {{grid list}} would do what you want, as would setting each list item to display: inline-block as with Module:List. It cannot be done with div col. Izno (talk) 03:09, 22 May 2025 (UTC)
- Ifly6, perhaps Izno already solved it for you but I still do not understand your question and do not see the sorting involved in your previous attempt. Do you still need this? If so, please specify both an input, as well as your sorted output, otherwise I do not see how to respond. Do you want to take the digits 1 to 12 in an already sorted input file, and display them as a 4 x 3 column table? Is that the question? Do you want to take unsorted input (example, please!) and sort it, displaying the results in columns? Mathglot (talk) 03:29, 22 May 2025 (UTC)
- I'm not sure how I would make it much simpler. The actual problem I want to solve is here: Template:Politics of the Roman Republic. There is a two-column {{div col}} right now, but the list of links under Magistrates is wrongly ordered in the way I described above.
- It doesn't seem that {{grid list}} solves the issue. I can't get the columns to be small enough to fit within the side bar. Ifly6 (talk) 03:47, 22 May 2025 (UTC)
- Grid list does solve the issue of getting things in the order you want in the number of columns you want, it just doesn't actually line things up in a grid, because it's actually a flex list and not a grid list. Sigh @ whoever named it that. It only has about 60 uses so renaming it wouldn't cause too much grief but then I'd have to do work implementing a grid. :') Izno (talk) 04:50, 22 May 2025 (UTC)
- Ok, I've added an example on the template of interest with {{flex list}} as well as a new parameter to support this kind of case. Izno (talk) 05:14, 22 May 2025 (UTC)
- For some reason it seems to display just like a horizontal list with no bullets between?
- I think I'd still want the columns for spacing. Ifly6 (talk) 16:45, 22 May 2025 (UTC)
- The "10em" is not a thing. But yeah, I see what you mean. I was afraid that would be an issue. What you indeed want is some sort of actual {{grid list}}. I'm not sure how that should be supported ultimately as supporting smaller resolutions would need to be thought about, but it's probably not difficult on the face of it and just needs someone to do it. Izno (talk) 19:37, 22 May 2025 (UTC)
- Ok, I've hacked together a really basic {{grid list}} as a proof of concept. I'm not sure what I want to name it, but it does what it says on the tin. Only supports two columns, and the columns parameter is soft required, yadda yadda. Izno (talk) 19:56, 22 May 2025 (UTC)
- And now documentation. Izno (talk) 20:05, 22 May 2025 (UTC)
- That's fantastic. Is it stable (enough) to use in a sidebar? Thanks! Ifly6 (talk) 20:48, 22 May 2025 (UTC)
- There's nothing particularly unstable about it if you understand CSS grid. I just don't know if the template is worth it, rather than perhaps a solution specific to that sidebar with its own TemplateStyles. I'm inclined to keep the template because I suspect not all uses of {{aligned table}} are accessibility kosher, but then it might turn out this template isn't used anywhere besides your template after all. (And I don't know/want there to be big extensions on the thing necessarily........) But sure, go for it. Izno (talk) 21:28, 22 May 2025 (UTC)
- That's fantastic. Is it stable (enough) to use in a sidebar? Thanks! Ifly6 (talk) 20:48, 22 May 2025 (UTC)
- The "10em" is not a thing. But yeah, I see what you mean. I was afraid that would be an issue. What you indeed want is some sort of actual {{grid list}}. I'm not sure how that should be supported ultimately as supporting smaller resolutions would need to be thought about, but it's probably not difficult on the face of it and just needs someone to do it. Izno (talk) 19:37, 22 May 2025 (UTC)
- Ok, I've added an example on the template of interest with {{flex list}} as well as a new parameter to support this kind of case. Izno (talk) 05:14, 22 May 2025 (UTC)
- Grid list does solve the issue of getting things in the order you want in the number of columns you want, it just doesn't actually line things up in a grid, because it's actually a flex list and not a grid list. Sigh @ whoever named it that. It only has about 60 uses so renaming it wouldn't cause too much grief but then I'd have to do work implementing a grid. :') Izno (talk) 04:50, 22 May 2025 (UTC)
- Maybe this clarifies? I don't want anything resorted. I want it displayed in the sorted order just such that when displaying it iterates to the right instead of iterating down. Ifly6 (talk) 03:50, 22 May 2025 (UTC)
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 |
- Do you know about creating tables at Wikipedia? They arrange things by default from left to right, up to the total number of columns you want. See Help:Table. If you are using the Visual Editor, it offers you some shortcuts to creating a table of a certain number of rows and columns, and then you just fill in the values in the cells. Would that solve your problem? In theory, Izno's grid solution is better, because tables are not supposed to be used just for layout, CSS should be. But the table approach might get you started, and then you can look into how to approach a grid starting from a table, which might be easier for you. Or, just jump straight to grid. Mathglot (talk) 09:18, 22 May 2025 (UTC)
- I tried putting a table in the sidebar but it didn't seem to render properly: it just shows a single
{character. Ifly6 (talk) 16:42, 22 May 2025 (UTC) - This doesn't work because of the limitations of the | character having multiple meanings (in the context of a template, it looks like a template, not a table). There is at least 1 easy workaround for it({{Aligned table}}) and one harder (
{{!}}) but you would indeed rely on using a table for presentation. Izno (talk) 19:37, 22 May 2025 (UTC)- (In some places, like {{History of Chad}}, {{aligned table}} is used more or less reasonably. I suspect in most others what is not had is a table and instead a presentational use of a table, as this case would be if such were used.) Izno (talk) 19:41, 22 May 2025 (UTC)
- @Ifly6: The main problem with the
|character is that the template parser sees it as the start of a new parameter. For this reason, the{{!}}magic word was created. There's a whole suite of templates, such as{{(!}}(opening round bracket followed by exclamation point), that allow table markup to be passed as parameters. --Redrose64 🌹 (talk) 21:57, 22 May 2025 (UTC)
- I tried putting a table in the sidebar but it didn't seem to render properly: it just shows a single
- Do you know about creating tables at Wikipedia? They arrange things by default from left to right, up to the total number of columns you want. See Help:Table. If you are using the Visual Editor, it offers you some shortcuts to creating a table of a certain number of rows and columns, and then you just fill in the values in the cells. Would that solve your problem? In theory, Izno's grid solution is better, because tables are not supposed to be used just for layout, CSS should be. But the table approach might get you started, and then you can look into how to approach a grid starting from a table, which might be easier for you. Or, just jump straight to grid. Mathglot (talk) 09:18, 22 May 2025 (UTC)
"Template:Nonstandard list end" listed at Redirects for discussion
[edit]
The redirect Template:Nonstandard list end has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at Wikipedia:Redirects for discussion/Log/2025 November 23 § Template:Nonstandard list end until a consensus is reached. — GhostInTheMachine talk to me 13:47, 23 November 2025 (UTC)