Page MenuHomePhabricator

Table: Add alignment prop
Closed, ResolvedPublic2 Estimated Story Points



By default, table cell contents are aligned to the start of the cell. Sometimes, content should be aligned to the end of a cell (e.g. for numbers) or the center (for structural cells meant to create hierarchy).

We need to provide an easy way to enable users of this component to set the alignment on a column's cells (both th and td elements).


Add a property to the TableColumn type called textAlign that defaults to start but also allows values center and end. A dynamic CSS class can then be added to the cells for that column to set the alignment.

Acceptance criteria

  • Behavior for text vs. other elements/components is defined by design
  • textAlign property is added to the TableColumn type
  • textAlign property is handled inside the Table component
  • Demos added for this behavior

Related Objects

In ProgressSarai-WMDE

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 1010921 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] Table: Make it possible to align cell content to the right

AnneT triaged this task as Medium priority.Mar 18 2024, 4:51 PM
AnneT moved this task from Inbox to Up Next on the Design-System-Team board.
lwatson set the point value for this task to 2.Mar 18 2024, 5:27 PM

Change #1010921 merged by jenkins-bot:

[design/codex@main] Table: Make it possible to set text alignment per column

Change #1016452 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v1.3.5 to v1.3.6

Change #1016452 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.3.5 to v1.3.6

Volker_E removed a project: Patch-For-Review.
Volker_E updated the task description. (Show Details)