Behaviour SwRS-MDOKFSTUDIO-TABLE-111
Column alignment sets the colons of the caret's column
When the writer runs Column alignment with left, center or right, the extension SHALL rewrite only the cell of the delimiter row that belongs to the caret's column, with a colon on the left (left), on both sides (center) or on the right (right) of its dashes, keeping at least three dashes.
Step 2 of path 1 in StRS-MDOKFSTUDIO-TABLE-016: from “A pipe table is in the text” to “The column is aligned”.
Scenarios 8
The situations the tests check; open one to read it.
nominalCentre a column
Giventhe caret in the second column of a pipe table whose delimiter cell is ---
WhenColumn alignment center is run
Thenonly the second delimiter cell changes to :---: and the other lines are unchanged
boundarySame alignment
Givena column already aligned left
Whenleft is run again
Thenno edit is produced
boundaryWidth of the delimiter cell and replacing an alignment
| Delimiter cell and choice | Outcome |
|---|---|
| a longer cell "|----------|", left | "|:---------|" (a dash is given up, never below three dashes) |
| a padded cell of exactly three dashes "| --- |", left | "| :--- |" (a trailing space is given up, keeping at least one) |
| a column aligned right, left | the marker becomes :--- with no leftover colon |
| a short cell ":--", right | "---:" (the cell grows to three dashes) |
nominalCaret in any row, with or without edge pipes
Giventhe caret in a body cell, and in another run in the delimiter row
a table written "a | b", the caret in the second column and right run
a table written "a | b", the caret in the second column and right run
WhenColumn alignment is run
Column alignment is run
Column alignment is run
Thenthe column of the caret is aligned
the second delimiter cell becomes ---:
the second delimiter cell becomes ---:
refusalOutside a pipe table or without a valid choice
| Input | Outcome |
|---|---|
| the caret in a paragraph | no edit is produced |
| the caret in a table and the choice "justify" | no edit is produced |
| the caret in a table and no choice | no edit is produced |
boundaryCaret in the text after a row's closing pipe
Giventhe caret in the tail of a row, the text after the closing pipe of its last column (see SwRS-MDOKFSTUDIO-TABLE-094)
Whena column alignment is chosen
Thenno edit is produced: no column is under the caret
nominalThe menu of Left, Center and Right
Giventhe caret in a pipe table
Whenthe writer presses Column alignment and chooses Center
Thenthe menu lists Left, Center and Right (option values left, center and right) and the delimiter cell of the caret's column is rewritten as in the "Centre a column" scenario
boundaryStrict mode
Giventhe strict mode
Whenthe buttons are listed
Thenthere is no Column alignment button