Page MenuHomePhabricator

Copy align and text-align and valign and vertical-align when inserting a new row
Closed, ResolvedPublic

Description

When editing a table where some columns are left/center/right aligned, currently a newly created row does not obtain any of this alignment. Let's copy it from the row cells above.

We want to support the following variants:

<td align="right"></td>
<td style="text-align: right"></td>
<tr align="right"></tr>
<tr style="text-align: right"></tr>

<td valign="top"></td>
<td style="vertical-align: top"></td>
<tr valign="top"></tr>
<tr style="vertical-align: top"></tr>

Note: align and valign are deprecated DOM attributes, but still widely used in Wikipedia articles.

Event Timeline

Change #1140662 had a related patch set uploaded (by Simon04; author: Simon04):

[VisualEditor/VisualEditor@master] Copy align and text-align when inserting a new row

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

I think there's another case when a table consists of a header row followed by data rows. I can imagine in these cases the header row has different styles to the data row. If clicked on the header row and did insertBelow, would I want to clone styles from the data row (as the new row will be a data row)? What if I wanted to add a second header row?

Actually we create a header row when you do this, so copying styles from the header is fine.

Change #1140662 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Copy align and text-align when inserting a new row

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

Change #1140750 had a related patch set uploaded (by Simon04; author: Simon04):

[VisualEditor/VisualEditor@master] Copy align and text-align to <tr> when inserting a new row

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

Change #1140980 had a related patch set uploaded (by Simon04; author: Simon04):

[VisualEditor/VisualEditor@master] Copy valign and vertical-align when inserting a new row

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

Change #1140750 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Copy align and text-align to <tr> when inserting a new row

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

Change #1140980 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Copy valign and vertical-align when inserting a new row

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

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

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (663f766db)

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

Change #1141120 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (663f766db)

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

simon04 renamed this task from Copy align and text-align when inserting a new row to Copy align and text-align and valign and vertical-align when inserting a new row.May 4 2025, 6:13 AM
simon04 updated the task description. (Show Details)