Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Page MenuHomePhabricator

Provide a way to align/justify the contents of a table cell
Open, LowestPublic

Description

A request for the ability to center-justify the text in a tables cells/rows/columns.
This is usually done by adding style="text-align: center;" to either the entire table, or rows, or cells.
Main documentation at https://www.mediawiki.org/wiki/Help:Tables#Attributes_on_tables

Event Timeline

Elitre raised the priority of this task from to Needs Triage.
Elitre updated the task description. (Show Details)
Elitre added a project: VisualEditor.
Elitre subscribed.
Quiddity added a project: VisualEditor-Tables.
Quiddity set Security to None.
Quiddity subscribed.
Jdforrester-WMF renamed this task from Center justify text in table cell to Provide a tool to center-justify the contents of a table cell.Aug 4 2015, 7:24 PM
Jdforrester-WMF triaged this task as Lowest priority.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.

I'm adding right-justify to the request, if that's ok.

Elitre renamed this task from Provide a tool to center-justify the contents of a table cell to Provide a way to justify the contents of a table cell.Feb 1 2016, 9:02 AM

Note that there is a request for the table syntax to make it 'easier' to do column/row alignment of table cells T2418: Easier and better alignment within Wiki Tables (but mostly discussed in T2986). Just to point out that this isn't particularly easy, even in wikicode, so any improvement here would probably be very much appreciated by editors.

Yes, I'd rather VE didn't support and encourage the status-quo of using style attributes.

この仕様は、修正されないのですか?
Does this specification is not been corrected?

Yes, I'd rather VE didn't support and encourage the status-quo of using style attributes.

I don't think arbitrary styling is necessary here? Text alignment is pretty easy to figure out with classes that also convey semantic information e.g. <td class="number">. In English, numbers are generally right aligned; normal text is left aligned, dashes and abbreviations are generally centered. Supporting basic classes for certain kinds of information seems entirely reasonable (if we don't support class provision today in VE?).

Esanders renamed this task from Provide a way to justify the contents of a table cell to Provide a way to align/justify the contents of a table cell.Apr 28 2022, 12:04 PM

The main problem here is there are a many ways to set the alignment of a table cell:

  • style attribute
  • align attribute
  • class attribute
  • style attribute on the parent row, table, or other container
  • class attribute on the parent row, table, or other container

Even if we decide on the cell level style attribute, the editing interface would have to be aware of all the other factors to correctly show the existing alignment. For example the default alignment of <th> is center due to a CSS rule. Further complicating this is that it could vary by skin (although perhaps we can ignore that edge case).

A simpler version would explain in the interface that we are only able to set and read the alignment by the cell's style attribute, and that this may be in conflict with other inherited styles.

Change 787507 had a related patch set uploaded (by Esanders; author: Esanders):

[VisualEditor/VisualEditor@master] [WIP] Set table cell alignment

https://gerrit.wikimedia.org/r/787507

Change 787510 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] [PULL THROUGH] Set table cell alignment

https://gerrit.wikimedia.org/r/787510

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/adfa52d0c8/w/