Help talk:Table/Archive 11
| This is an archive of past discussions about Help:Table. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
| Archive 5 | ← | Archive 9 | Archive 10 | Archive 11 |
Bad html markup advise
In the section "1.3 Column and row header cells" bad html advice is being given. Proper html and proper accessibility guidelines state that you never use ! alone in the middle of a table to show a header. "! rowheader1" is wrong. If you must show a header midtable it must contain the scope="row" statement. It can cause errors in older screen readers and is not proper html. This should be changed. Fyunck(click) (talk) 06:30, 14 October 2022 (UTC)
- Accessibility guidelines have been added in various places. Jroberson108 (talk) 03:39, 13 December 2023 (UTC)
Need help
Can someone correct the first table at 2025 Greenlandic general election? Can't figure out how to fix it. Thanks. Semsûrî (talk) 17:25, 2 March 2025 (UTC)
- @Semsûrî: There were too many
rowspan=andcolspan=attributes. The fix is to remove them all, and then add in only those that are necessary; which turned out to be just one - the one for the "Party" column heading. --Redrose64 🌹 (talk) 20:27, 2 March 2025 (UTC)- Thank you. Semsûrî (talk) 20:29, 2 March 2025 (UTC)
Rates per million. Change to rates per 100,000
The rates in the US tables are per 100,000. So I want to convert the rates in the Europe table below from "per million" to "per 100,000". That means moving the decimal place one place to the left. Can someone do this for me?
Better yet can someone explain exactly how to do it step by step in Libreoffice Calc. I will put this info in a section in Help:Table/Advanced or another table help page.
| Location | Year | Females | Males | Total |
|---|---|---|---|---|
| 2022 | 18 | 65 | 42 | |
| 2020 | 7 | 34 | 21 | |
| 2022 | 1 | 8 | 4 | |
| 2022 | 13 | 71 | 42 | |
| 2022 | 3 | 13 | 8 | |
| 2022 | 6 | 12 | 9 | |
| 2021 | 19 | 60 | 40 | |
| 2022 | 34 | 155 | 95 | |
| 2022 | 33 | 106 | 70 | |
| 2016 | 3 | 16 | 9 | |
| 2022 | 10 | 49 | 30 | |
| 2020 | 10 | 58 | 34 | |
| 2021 | 3 | 9 | 6 | |
| 2020 | 64 | 130 | 97 | |
| 2022 | 2 | 13 | 8 | |
| 2022 | 12 | 96 | 53 | |
| 2022 | 10 | 86 | 47 | |
| 2022 | 5 | 31 | 18 | |
| 2020 | 6 | 43 | 26 | |
| 2022 | 13 | 40 | 26 | |
| 2022 | 53 | 118 | 86 | |
| 2021 | 5 | 11 | 8 | |
| 2021 | 4 | 19 | 11 | |
| 2022 | 1 | 3 | 2 | |
| 2021 | 3 | 12 | 7 | |
| 2022 | 16 | 74 | 46 | |
| 2021 | 7 | 34 | 21 | |
| 2022 | 35 | 102 | 70 | |
| 2022 | 1 | 7 | 4 |
References
- ^ "Overdose situation (FAQ drug overdose deaths in Europe)". European Union Drugs Agency. Scroll down to Figure 1.5. Then; "Show data table".
--Timeshifter (talk) 14:57, 6 March 2025 (UTC)
- I figured out how to do it in free Google Sheets, freeware LibreOffice Calc, and free Excel online.
- See: User:Timeshifter/Sandbox284.
- --Timeshifter (talk) 22:11, 10 March 2025 (UTC)
- Simplified instructions are here:
- Help:Creating tables#Rates per million or per 100,000.
- --Timeshifter (talk) 00:56, 13 March 2025 (UTC)
PrimeHunter
Do we really link something like Notes: User:PrimeHunter (Talk) provided the code. Ask him for help.
on a help page? I have never seen something like that before. I regret reverting you, Timeshifter: I thought that you had added the information for the first time, not reinstating something that had been longstanding. HouseBlaster (talk · he/him) 19:04, 8 February 2024 (UTC)
- Why not? It is a help page. Linking to experts is some of the best possible help. Table help is some of the most complex help there is on Wikipedia. So I am not surprised you have not seen it before on other help pages. That link to PrimeHunter has been there for years. And just because you haven't seen something before is no reason to delete it. Not if you don't have a guideline to back it up. --Timeshifter (talk) 19:11, 8 February 2024 (UTC)
- The problem I see with the note is there are more appropriate places to ask for help (e.g. WP:VPT). HouseBlaster (talk · he/him) 03:31, 9 February 2024 (UTC)
- There is nothing stopping people from asking there. But it is not "more appropriate". Experts save time. They sometimes understand the history of the issue. VPT is not always helpful, and can be slow, or even useless, depending on your luck on whether an expert on a particular issue happens to be watching VPT. And if you want help in creating a similar find-and-replace with regex, then an expert who has created several of them already for tables, is invaluable. --Timeshifter (talk) 13:03, 9 February 2024 (UTC)
- It is more appropriate to ask at VPT, so that anyone can help. It is a fairly simple regex, so it is not like only PrimeHunter knows what to do. I will also note that at the time of this comment, PrimeHunter is the most recent person to edit VPT, and his last five edits are to VPT. HouseBlaster (talk · he/him) 15:24, 9 February 2024 (UTC)
- OK. Knowing about more help opportunities is better. I added "Or ask at WP:VPT." I just assumed people knew they could ask there too if needed. But newbies may not know. But it is not "more appropriate" to ask for help one way versus another. --Timeshifter (talk) 15:33, 9 February 2024 (UTC)
- I think the easiest way to resolve this dispute is to ask @PrimeHunter if he wants this invitation to ask him personally, or would rather editors ask at VPT. HouseBlaster (talk · he/him) 19:04, 9 February 2024 (UTC)
- Why are you wasting everybody's time with this? It's been there for years. And editors don't have to choose between one or the other. They now have both choices. They always had both choices. But now even newbies who don't know about WP:VPT know about that choice. Do you have something against providing more help opportunities on a help page? --Timeshifter (talk) 21:55, 9 February 2024 (UTC)
- I think people are better served by asking a wide variety of experts, as opposed to picking one and waiting for him to respond. HouseBlaster (talk · he/him) 23:03, 9 February 2024 (UTC)
- Well, if that's your choice for yourself, then fine. Please stop trying to impose your choice on others. --Timeshifter (talk) 23:08, 9 February 2024 (UTC)
- The regex was made for a specific article and the wikitext used there. Regex is very sensitive to the precise way wikitext is written and my regex was not designed to be likely to work on random tables. I didn't suggest it to be added here and nobody has asked me for help about it. I would probably answer quickly if it happened but it does appear odd to mention me in that way. PrimeHunter (talk) 15:27, 12 February 2024 (UTC)
- PrimeHunter. I've asked you about other stuff just because your username is mentioned on the table help pages. So since I remember your username, if I see you involved in a VPT discussion, then I know that asking you questions will be productive.
- You are linked from here too:
- Help:Tables and locations#Add flags. Link countries, states, etc. in tables. I, and others, have used that regex info many times. So thanks.
- I count 7 uses of regular expressions described in the 6 main table help pages. So it is good to have more ways to get regex help.
- --Timeshifter (talk) 20:11, 12 February 2024 (UTC)
- The regex was made for a specific article and the wikitext used there. Regex is very sensitive to the precise way wikitext is written and my regex was not designed to be likely to work on random tables. I didn't suggest it to be added here and nobody has asked me for help about it. I would probably answer quickly if it happened but it does appear odd to mention me in that way. PrimeHunter (talk) 15:27, 12 February 2024 (UTC)
- Well, if that's your choice for yourself, then fine. Please stop trying to impose your choice on others. --Timeshifter (talk) 23:08, 9 February 2024 (UTC)
- I think people are better served by asking a wide variety of experts, as opposed to picking one and waiting for him to respond. HouseBlaster (talk · he/him) 23:03, 9 February 2024 (UTC)
- Why are you wasting everybody's time with this? It's been there for years. And editors don't have to choose between one or the other. They now have both choices. They always had both choices. But now even newbies who don't know about WP:VPT know about that choice. Do you have something against providing more help opportunities on a help page? --Timeshifter (talk) 21:55, 9 February 2024 (UTC)
- I think the easiest way to resolve this dispute is to ask @PrimeHunter if he wants this invitation to ask him personally, or would rather editors ask at VPT. HouseBlaster (talk · he/him) 19:04, 9 February 2024 (UTC)
- OK. Knowing about more help opportunities is better. I added "Or ask at WP:VPT." I just assumed people knew they could ask there too if needed. But newbies may not know. But it is not "more appropriate" to ask for help one way versus another. --Timeshifter (talk) 15:33, 9 February 2024 (UTC)
- It is more appropriate to ask at VPT, so that anyone can help. It is a fairly simple regex, so it is not like only PrimeHunter knows what to do. I will also note that at the time of this comment, PrimeHunter is the most recent person to edit VPT, and his last five edits are to VPT. HouseBlaster (talk · he/him) 15:24, 9 February 2024 (UTC)
- There is nothing stopping people from asking there. But it is not "more appropriate". Experts save time. They sometimes understand the history of the issue. VPT is not always helpful, and can be slow, or even useless, depending on your luck on whether an expert on a particular issue happens to be watching VPT. And if you want help in creating a similar find-and-replace with regex, then an expert who has created several of them already for tables, is invaluable. --Timeshifter (talk) 13:03, 9 February 2024 (UTC)
- The problem I see with the note is there are more appropriate places to ask for help (e.g. WP:VPT). HouseBlaster (talk · he/him) 03:31, 9 February 2024 (UTC)
Strange page name
This page, "Help:Table. Advanced", has an unusual name that does not conform to any page naming scheme I have seen on Wikipedia. Is it a mistake? If not, what is the reasoning behind the name? If it is a mistake (or a rough draft name), I recommend "Help:Table/Advanced" as a more standard name. – Jonesey95 (talk) 20:59, 15 December 2023 (UTC)
- It is odd and looks like a typo. I see a section header with the same period: "mw-datatable. Highlight rows. White background". I recommend the same, remove the periods. Jroberson108 (talk) 21:06, 15 December 2023 (UTC)
- Jonesey95. See: Wikipedia talk:Article titles#Leftover subpages? Slashes are for subpages. For example:
- Special:MyPage/vector-2022.css which for me is User:Timeshifter/vector-2022.css - For Vector 2022.
- Special:MyPage/sandbox which for me is User:Timeshifter/sandbox.
- To find subpages:
- Special:Prefixindex/User:Timeshifter/
- --Timeshifter (talk) 05:07, 16 December 2023 (UTC)
- Exactly. This page appears to be intended as an adjunct to Help:Table, like Help:Table/Width. Hence the suggestion of a similar name. The current name makes no sense to me, and to at least one other editor. Again, what is the reasoning behind the name? – Jonesey95 (talk) 05:14, 16 December 2023 (UTC)
- This is not a minor subpage. There are whole new areas of table info not previously discussed in Help:Table. --Timeshifter (talk) 05:28, 16 December 2023 (UTC)
- It looks like the admin Novem Linguae substituted the slash. See diff. Edit summary: "Novem Linguae moved page Help:Table. Advanced to Help:Table/Advanced: periods very uncommon in titles, slash better I think".
- I looked at Wikipedia:Article titles and did not see a prohibition of periods in titles.
- I was mainly concerned that it may be a questionable use of subpages.
- But I can live with the slash if an admin sees no problem with it. --Timeshifter (talk) 09:37, 16 December 2023 (UTC)
- I moved it without seeing this talk page discussion. I guess we all had the same idea :) –Novem Linguae (talk) 09:43, 16 December 2023 (UTC)
- @Timeshifter: If you still couldn't find it, the restriction is mentioned at WP:TSC. Jroberson108 (talk) 10:04, 17 December 2023 (UTC)
- This is not a minor subpage. There are whole new areas of table info not previously discussed in Help:Table. --Timeshifter (talk) 05:28, 16 December 2023 (UTC)
- Exactly. This page appears to be intended as an adjunct to Help:Table, like Help:Table/Width. Hence the suggestion of a similar name. The current name makes no sense to me, and to at least one other editor. Again, what is the reasoning behind the name? – Jonesey95 (talk) 05:14, 16 December 2023 (UTC)
The restriction is only for periods used in particular ways. WP:TSC links to:
A plain old period is not prohibited. As noted in the Novem Linguae edit summary: "periods very uncommon in titles". --Timeshifter (talk) 11:57, 17 December 2023 (UTC)
Fork
I just discovered Wikipedia:Advanced table formatting, which is a fairly clear WP:SAMETYPEFORK of this page. This page was created because Help:Table was too long. If we merge the two pages, we will be back where we started. My proposed solution is a split followed by a merge. This page currently deals with two related, but distinct, ideas. One is "what you can do with a table": sections like Horizontal alignment in cells, Sortable tables, and Collapsible tables. The other is "how you create a table": sections like Tables and visual editor, Spreadsheet/database tables to wikitables, and Add link brackets to text in each cell in a column. I think we should split those sections out into a page such as Help:Creating tables, and then merge Wikipedia:Advanced table formatting with this page and the newly created page (I realize that page is older, but I think a help page belongs in the help namespace). Thoughts? HouseBlastertalk 20:22, 31 December 2023 (UTC)
- HouseBlaster. Feel free to do so. Please do not delete anything yet though. Let's see what the 2 pages look like first. Also, then we will have separate histories for each page to see clearly what is then rewritten or deleted. --Timeshifter (talk) 20:51, 31 December 2023 (UTC)
- Only two weeks later, I have created Help:Creating tables. HouseBlaster (talk · he/him) 21:47, 18 January 2024 (UTC)
- HouseBlaster. Thanks. I will not be able to help much the next week or two. You still need to remove the duplicate sections from Help:Table/Advanced. --Timeshifter (talk) 16:58, 19 January 2024 (UTC)
- Only two weeks later, I have created Help:Creating tables. HouseBlaster (talk · he/him) 21:47, 18 January 2024 (UTC)
Aligning table text to top of cells?
Is there help on when/how to align the body of text in table cells in css or wikipedia markup? I see this for image blocks. — Preceding unsigned comment added by Evanwolf (talk • contribs) 21:10, 29 January 2025 (UTC)
- @Evanwolf: It's not part of table syntax; you need to use CSS styling. See below.
| Three lines of text |
No alignment (default) | Top-aligned | Middle-aligned | Bottom-aligned |
- Documentation is here. --Redrose64 🌹 (talk) 22:00, 29 January 2025 (UTC)
See: Help:Table#Vertical alignment in cells. The CSS can be applied to a cell or a row.
Adjusted and simplified the wikitext. People using screen readers don't like breaks <br> in header text ("Three lines of text").
{| class=wikitable
|+ Demo of vertical alignment
|-
|style=max-width:3em |Three lines of text
|No alignment (default)
|style=vertical-align:top |Top-aligned
|style=vertical-align:middle |Middle-aligned
|style=vertical-align:bottom |Bottom-aligned
|}
| Three lines of text | No alignment (default) | Top-aligned | Middle-aligned | Bottom-aligned |
I just found this template I did not know about:
It allows one to set all rows in a table to be either top or bottom aligned.
The HTML attribute valign is allowed, but obsolete. See: Help:HTML in wikitext#Tables. --Timeshifter (talk) 03:58, 30 January 2025 (UTC)
- "Three lines of text" isn't header text. It's just another data cell on the same row that just happens to come first. I purposely didn't mention the
valignattribute, because it's obsolete in HTML5 (i.e. since 28 October 2014, just over ten years ago), and was deprecated more than 27 years ago (HTML 4.0, 18 December 1997 to be exact). Nobody should be using it in new tables. --Redrose64 🌹 (talk) 08:59, 30 January 2025 (UTC)
Line breaks in table cells
- Oops. Not header text. I think though that people with screen readers also don't like breaks in data cells in the middle of a sentence or phrase like "Three lines of text". --Timeshifter (talk) 16:08, 30 January 2025 (UTC)
- Let's ask an expert. Graham87, how do screen readers interpret the
<br />tag? Is it as newlines, as spaces, or as something else? --Redrose64 🌹 (talk) 22:39, 30 January 2025 (UTC)- As newlines. Graham87 (talk) 08:32, 31 January 2025 (UTC)
Thank you --Redrose64 🌹 (talk) 20:29, 31 January 2025 (UTC)- @Graham87: Thanks. How does your screen reader indicate newlines? I want this for the help pages so people see why that newlines in the wrong places can hurt accessibility. --Timeshifter (talk) 11:22, 1 February 2025 (UTC)
- By creating a new line at the point of the br tag. Graham87 (talk) 13:19, 1 February 2025 (UTC)
- As newlines. Graham87 (talk) 08:32, 31 January 2025 (UTC)
- Let's ask an expert. Graham87, how do screen readers interpret the
- Oops. Not header text. I think though that people with screen readers also don't like breaks in data cells in the middle of a sentence or phrase like "Three lines of text". --Timeshifter (talk) 16:08, 30 January 2025 (UTC)
@Graham87: - I mean what does the screen reader say when it comes upon a br tag? --Timeshifter (talk) 00:45, 2 February 2025 (UTC)
- It doesn't say anything. It just ... shows that there's a new line. Graham87 (talk) 03:36, 2 February 2025 (UTC)
- @Graham87: As the screen reader reads aloud "Three lines of text" in that cell using br tags does it pause at the line breaks? Is that annoying?
- I did some reading:
- https://www.google.com/search?q=how+do+screen+readers+indicate+a+new+line+or+line+break
- https://stackoverflow.com/questions/32204760/use-of-br-and-accessibility
- In the above link there seem to be various methods to eliminate that pause. Such as:
<br aria-hidden=true />- But that is too much to expect of average table editors who often use breaks in header cells.
- Template:Break lines can add line breaks. Shortcut: {{brl}}
- Wikitext:
{{brl|Three
lines
of text}}
- Produces:
- Three
lines
of text - Maybe WP:VPT
- Can come up with a variation of {{brl}} that uses
<br aria-hidden=true />- Maybe {{brh}} - short for Template:Line break hidden
- That would be easier to use than
style=max-width:3em - Max-width requires fiddling with different widths to make it work.
- --Timeshifter (talk) 11:57, 2 February 2025 (UTC)
- Nope, my screen reader doesn't pause between new lines during say all by default (though it can be set that way). Honestly I'd rate the importance of extra line breaks for accessibility in cases like this about 0.01 out of 10, at the very most. Graham87 (talk) 12:19, 2 February 2025 (UTC)
- @Graham87: That's good to know. It makes things easier for table editors. So if screen readers nowadays ignore line breaks <br> by default, then table editors can just keep on adding line breaks to header and other cells. I will note that somewhere in the table help pages. Soon, I hope. --Timeshifter (talk) 12:49, 2 February 2025 (UTC)
- I never said they ignore line breaks (say all is a reading mode; a lot of people (including me) often read by arrowing up and down a page, or some other way). I think it's best to just leave things as they are. Graham87 (talk) 13:58, 2 February 2025 (UTC)
- @Graham87: OK. Will do. --Timeshifter (talk) 14:25, 2 February 2025 (UTC)
- I never said they ignore line breaks (say all is a reading mode; a lot of people (including me) often read by arrowing up and down a page, or some other way). I think it's best to just leave things as they are. Graham87 (talk) 13:58, 2 February 2025 (UTC)
- @Graham87: That's good to know. It makes things easier for table editors. So if screen readers nowadays ignore line breaks <br> by default, then table editors can just keep on adding line breaks to header and other cells. I will note that somewhere in the table help pages. Soon, I hope. --Timeshifter (talk) 12:49, 2 February 2025 (UTC)
- Nope, my screen reader doesn't pause between new lines during say all by default (though it can be set that way). Honestly I'd rate the importance of extra line breaks for accessibility in cases like this about 0.01 out of 10, at the very most. Graham87 (talk) 12:19, 2 February 2025 (UTC)
Any way to freeze the top row (header info) of a table?
Is there any way to freeze the top row of a table, the header info for the columns? So that the top row floats down the screen as user scrolls down the table, that is, so that in a table with many rows the viewer can scroll down through the rows to the desired item and still see the column header info. UnderEducatedGeezer (talk) 20:19, 29 April 2019 (UTC)
- That's way too useful a request to get any traction. They're too busy perfecting WP:Flow. EEng 23:17, 29 April 2019 (UTC)
Section on moving a column/row outdated Suggestion
The visual editor now allows whole columns/rows to be moved. That would be an easier method than hand editing.--Jessemulert (talk) 23:03, 25 April 2021 (UTC)
Set one column in italics?
Is there a way to set one column of a table in italics without marking each entry individually. I'm looking at List of trees and shrubs by taxonomic family where almost every entry in the column "Scientific name" should be in italics. I'm not terribly literate in the intricacies of tables, but I can follow directions if I can find them. Thanks, SchreiberBike | ⌨ 17:34, 15 May 2022 (UTC)
- @SchreiberBike:
''has to be used for each item in a column. Since there are so many, I went ahead and made them italics using find and replace. Feel free to modify any that shouldn't be italics. Jroberson108 (talk) 21:40, 15 May 2022 (UTC)- @Jroberson108: Well, thanks a million. You've got some find and replace skills that go beyond my own, or you did a lot of it manually. Thank you and keep up the good work. (I will go in and fix some odd cases.) SchreiberBike | ⌨ 00:36, 16 May 2022 (UTC)
- @SchreiberBike: You're welcome. I used a regular expression to find and replace them all in one go. I manually modified one to move the parenthesis outside the italics. I just saw that I missed a table in the second section, so I went ahead and did those too. Hopefully the bulk of it is done now. Jroberson108 (talk) 03:08, 16 May 2022 (UTC)
- @Jroberson108: Well, thanks a million. You've got some find and replace skills that go beyond my own, or you did a lot of it manually. Thank you and keep up the good work. (I will go in and fix some odd cases.) SchreiberBike | ⌨ 00:36, 16 May 2022 (UTC)
Where to request new extension to wikitable?
I'd like to be able to use a subclass, as in the following:
| Title | Album details | Peak chart positions | Certifications | ||||
|---|---|---|---|---|---|---|---|
| US Country [1] |
US [2] |
CAN Country [3] |
CAN [4] |
UK [5] | |||
| Rumor Has It |
|
2 | 39 | — | — | — | |
| For My Broken Heart |
|
3 | 13 | 1 | 78 | — | |
| It's Your Call |
|
1 | 8 | 1 | 59 | — | |
| "—" denotes releases that did not chart | |||||||
References
- ^ Cite error: The named reference
american country albumswas invoked but never defined (see the help page). - ^ Cite error: The named reference
americanalbumswas invoked but never defined (see the help page). - ^ Cite error: The named reference
canadiancountryalbumswas invoked but never defined (see the help page). - ^ Cite error: The named reference
canadianalbumswas invoked but never defined (see the help page). - ^ "UK Top 40 Database". everyhit.com. Retrieved 27 September 2010.
- ^ "Search results - "Rumor Has It"". Recording Industry Association of America. Retrieved 30 September 2010.
- ^ a b c "CRIA searchable database". Canadian Recording Industry Association. Retrieved 28 September 2010.
- ^ "Search results - "For My Broken Heart"". Recording Industry Association of America. Retrieved 30 September 2010.
- ^ "Search results - "It's Your Call"". Recording Industry Association of America. Retrieved 30 September 2010.
There are three cells in the table above that contain a 1. It would be good if these cells were automatically shaded (as has been manually done in the second row), without additional markup in the cells themselves. I know this to be possible using CSS, so the question is how can this be achieved in wiki?
I'm thinking I need to add
class="wikitable discog plainrowheaders" style="text-align:center;"
or similar. And then discog can be defined elsewhere.
Am I even in the right place to suggest this? — Preceding unsigned comment added by 79.65.103.181 (talk) 20:26, 9 July 2017 (UTC)
References
- @Jroberson108: Any ideas? This is not my area of knowledge. Should this thread be moved to Help talk:Table or WP:VPT? --Timeshifter (talk) 00:25, 1 August 2025 (UTC)
- I would recommend sticking with inline styles as you've done. What does the yellow represent? Does it convey information by visual means only? If so, then it may be an accessibility issue that screen readers can't convey. Jroberson108 (talk) 01:09, 1 August 2025 (UTC)
- For screen readers asterisks could be added too. See:
- Template:Sticky table start#Example with sticky row 2 and column 2
- --Timeshifter (talk) 14:02, 1 August 2025 (UTC)