The problem:
Currently it is difficult for new editors and nonoverseeable/unclear/confusing to experienced editors to edit tables via the source editor. To see how an editor views the source editor when clicking "Edit" on a section that contains a table to edit the table see this example - it should be clear that this is not easy for new editors to make sense of and edit properly and is at least cluttered/nonoverseeable for anybody else too.
Why it is a significant problem:
- Tables are important content of Wikipedia, featured in many articles and often displaying very useful, well/better-structured content that is sometimes making up most of an article's content and often of high interest to the readers of the article.
- Many - afaik most - editors are using the source editor. This is partly because it has some important advantages over the VisualEditor and some things are only possible with the source editor.
- It is important to enable high levels of contribution/editing to table-contents and make it easy for people to add new or edit entries.
- This is one of a series of tasks that would allow (/ improve) converting the Events list of https://en.wikipedia.org/wiki/2020_in_science to a table as suggested on the page's talk page. This would also allow many more features and could make the article shorter for the reader and more useful. Converting lists to tables or something table-like could also be useful for many other lists and it would be important to make table-editing easier before converting some lists to tables or something table-like. Other issues of this series are linked under "Further issues" below.
Suggested solution:
- At the top and bottom of a table and/or at the row that the user is hovering the mouse over display an "Add"/"+" button that, when clicked, opens the source editor with content for an additional row with empty columns in the edit field (example below) but when previewed it shows either the entire table including the new row or only the new row and the table-header.
- At the row that the user is hovering the mouse over display an "Edit"/"pencil-icon" button that, when clicked, opens the source editor with only the selected column being shown in the edit field but when previewed it shows either the entire table including the edited row or only the edited row and the table-header.
- For people editing with the source editor also display an option to edit via VisualEditor for tables only with an additional edit-button next to tables.
A basic example for "Comparison of display technology" of what might show in the edit field after an "Add" button is clicked (only content relevant to a new row):
|- | {{rh}} | | | | | |
The user could then add content to the columns to this much clearer, smaller part of wikitext and preview it to make sure everything is in the right columns.
The article could also specify the expected row-content in some way via a comment in the wikitext that is not displayed in the article but displayed in the edit-view. For example:
<!-- !row_template |- | {{rh}} | Display technology | Screen shape | Largest known diagonal | Typical use | Usable in bright room | {{yes}} / {{partial}} / {{no}} -->
Additional suggestions/requests beyond the basic solution:
Users would still be able to edit the table the usual way with the source editor or change the edited row by looking at the source of the other rows. The template simplifies the most common edits to the table and if the template is not completely fit for the edited row it still makes things a bit less confusing for the editor.
However, probably only later on, there could be more advanced row_templates so that for the "Comparison of display technology" row template it somehow could indicate that the "Largest known diagonal" has two options: a) diagonal in inch and cm or b) the string "(limited only by brightness)" with a colspan=2. Such column-content-options could also be used for the yes/partial/no-column in the example.
There could also be a "copy row template"-button next to the hovered row to copy a template for the selected row. Maybe it would be best if one first has to click "add table entry"/"add"/"+"/... and then it gives the user the option to use either the default template or a template generated from a row the user can then select.
Furthermore the VisualEditor for tables could be improved so that it's possible to do everything that can be done with the source editor.
Further issues:
T258382: Fix the display of tables on mobile (responsive web design: when the user taps on a table rotate the screen for a fullscreen view) (display of tables on mobile)
T233340: Add sortability to sortable tables for readers of the mobile web site (sortability)
T181452: Add sortability to tables with "sortable" class in the apps (sortability)