Problem with sortable tables that include "Vert Header" template

edit

FYI: For some reason if a table is sortable and has "Vert header" then the sorting is broken.

NevilleDNZ (talk) 23:05, 22 June 2017 (UTC)Reply

    • Fixed... used the stp=1 option.

NevilleDNZ (talk) 23:12, 22 June 2017 (UTC)Reply

Yes, that's intentional. After tinkering with different positions for the sorting arrows, I decided that no padding should be added to the right side of the cells — only upwards and only if necessary. However, since I can only set inline CSS for these headers, I can't make a simple, universal rule for whether, how and where the arrows are displayed, and there's no other reliable way to tell whether or not a column is supposed to be sortable or not from within the module that powers this template, so the user has to specify it instead. Since the default state of a table is to be unsortable, I set (and reinforced) unsortability as the default, which makes the stp parameter mandatory for sortable columns. I avoided the possibility of having a sortable column without arrows, which would confuse readers. —  Andreyyshore  T  C  13:11, 29 Oct 2018 (UTC) 

Header text readable from top to bottom. Or at an angle

edit

User:Andreyyshore. Thanks for the template. Would it be possible to have a parameter to make the header text readable from top to bottom like this:

H
e
a
d
e
r

Or maybe like some of the 45 degree slant examples in these articles:

--Timeshifter (talk) 17:32, 14 June 2018 (UTC)Reply

Two-line
example
You're welcome. writing-mode: vertical-lr; text-orientation: upright would work fine in Chrome for stacked text; I'll have to do some testing when I have more time, as that might affect compatibility with some browsers. Also notice how the first one is "underlined" to the left when you hover over it?nevermind
Maybe slanted headers should be implemented in a separate template/module, but I'll look into it. I imagine this creating huge problems in older versions of IE. —  Andreyyshore  T  C  12:44, 29 Oct 2018 (UTC) 

(unindent). Thanks. I just installed Chrome. It is working in Chrome, but not in Firefox or Explorer. --Timeshifter (talk) 00:18, 30 October 2018 (UTC)Reply

cellstyle parameter request

edit

@Andreyyshore: Great template. The current style parameter applies to the div with the text. I would like to also have a cellstyle parameter for the whole cell, e.g. for a background color if a table like 2018 ATP World Tour#Titles won by player is changed to use the template. A style= before the template is ignored because it adds its own style=. Consider the below example where "Singles" does what is currently supported and tries an ignored style=. "Doubles" makes an ugly unstable hack by tagging cellstyling onto va=bottom. I haven't used this hack in practice and don't want to. "Mixed doubles" has the code I would like to produce the same result as "Doubles". I don't know Lua but could probably guess how to do it – or maybe break the module. PrimeHunter (talk) 23:47, 14 July 2018 (UTC)Reply

Singles
Doubles
Mixed doubles
 
Andreyyshore has added the requested cellstyle parameter. Thanks. PrimeHunter (talk) 11:46, 29 October 2018 (UTC)Reply
You're welcome. Sorry for taking so long; I was on a wikibreak, only making a few minor contributions lately. —  Andreyyshore  T  C  12:22, 29 Oct 2018 (UTC) 

Tooltip

edit

I made great use of this template here. Vertical headers are a space saver but a headache to read, though. Notice I used {{h:title}} to give a tooltip on unlinked headers. How about adding a tooltip option to this template/module? (Or even making it default!). Cheers. Guarapiranga (talk) 23:52, 13 November 2019 (UTC)Reply

Vertical Header Glitching on Mobile Device

edit

When I look at the 2020 United States Presidential Election table I notice the table glitches. This occurs on my mobile device. The vertical headers appear blank for over 15 seconds. In some cases I have to click on them to get them to appear. It makes it hard to read and it’s annoying. Can someone please resolve this? Pentock (talk) 01:52, 3 September 2020 (UTC)Reply

References

edit

Can this template be made to show refs (here, for instance)?

Also, if I add flags there, they show unrotated. What's the best way to circumvent that? Cheers. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚  05:58, 30 June 2021 (UTC)Reply

Proposal to discourage vertically oriented ("sideways") column headers in tables

edit

I have initiated a discussion at Wikipedia talk:Manual of Style/Tables#Proposal to discourage vertically oriented ("sideways") column headers, to may interest contributors to this article. 𝕁𝕄𝔽 (talk) 17:15, 6 December 2023 (UTC)Reply

Sometimes vertical text moves into adjacent header cells on narrow screens

edit

Note: This is discussed here too: Wikipedia talk:Manual of Style/Tables#Proposal to discourage vertically oriented ("sideways") column headers.

This may only be a problem with poorly chosen table excerpts. Look at this in side-by-side preview on bigger screens to easily see the problem.

Narrow your browser window to see the problem discussed below. This is a peculiar problem. I don't see it happening on the full table here. Maybe it's not a problem at all. I haven't seen it other than below. Please check other tables using vertical headers in narrowed browser windows. The last table below shows that it is not a problem if there is something in a cell in the column. And at least 3 characters in one of the cells below a 2-column vertical header.

Jroberson108, Andreyyshore, and all. {{Sticky table start}} was created July 26, 2024. It allows sticky left columns. This helps a lot with wide tables, especially on mobile.

The judicious use of vertical headers also helps with wide tables. See table below using vertical headers combined with {{Sticky table start}}.

List of countries with annual rates and counts for killings by law enforcement officers. With breakdown by police, etc..
Location Region Killings
Police
Military
Intel
agencies
Other
Population Rate per 10 million Year listed Notes
Source
  Venezuela Americas 5,286 28,887,118 1829.9 2019

Currently, on mobile, or when the browser window is narrowed on other monitors, there is misalignment of the vertical text within the header cell borders of this table. The vertical text moves into an adjacent header cell

Also, the problem exists when sticky headers are not used. As below:

List of countries with annual rates and counts for killings by law enforcement officers. With breakdown by police, etc..
Location Region Killings
Police
Military
Intel
agencies
Other
Population Rate per 10 million Year listed Notes
Source
  Venezuela Americas 5,286 28,887,118 1829.9 2019

It's not a problem here below because this excerpt has cells with some characters in them. Except for the "Source" column.

List of countries with annual rates and counts for killings by law enforcement officers. With breakdown by police, etc..
Location Region Killings
Police
Military
Intel
agencies
Other
Population Rate per 10 million Year listed Notes
Source
  Afghanistan Asia 606 49 267 234 56 35,530,000 170.5 2018
  Guyana Americas 12+ 12 0 0 0 787,076 152.5 2018

--Timeshifter (talk) 11:08, 23 November 2024 (UTC)Reply