Behaviour SwRS-MDOKFSTUDIO-TABLE-106
The Table action inserts a pipe table of the chosen size on its own lines
When the writer runs the Table action with a size of R x C, 1 to 9 each, in a block editor, the extension SHALL insert after the end of the selection a pipe table of C columns with a header row of cells "Column 1" to "Column C", a --- delimiter row and R minus 1 empty body rows, add only the blank lines needed to set it apart, leave the selection untouched and select the first header cell, and insert nothing for a missing, malformed or out-of-range size.
Step 1 of path 1 in StRS-MDOKFSTUDIO-TABLE-016: from “A block text box is open in edit mode” to “A pipe table is in the text”.
Scenarios 7
The situations the tests check; open one to read it.
nominal3 rows and 4 columns
Givenan empty block and the size 3x4
Whenthe action runs
Thenthe table has 4 header cells, a delimiter row of 4 --- cells and 2 empty body rows, and "Column 1" is selected
boundarySize limits
| Size | Outcome |
|---|---|
| 1x1 | a header and its delimiter row only |
| 9x9 | 9 columns and 8 empty body rows |
| 1x9 | a table is inserted |
nominalIn the middle of a paragraph
Giventhe caret inside a paragraph
Whenthe action runs
Thenthe paragraph is split and the table sits on its own lines between its two parts
boundaryCaret inside a table
Giventhe caret in a row of a pipe table, a {list-table} or an HTML table
Whenthe action runs
Thenthe new table goes on its own lines after the last line of that table and the existing table stays whole
boundaryAfter a line break, a blank line or a selection
Giventhe caret after a line break, or after a blank line, or with text selected
Whenthe action runs
Thenonly the missing blank lines are added and a selection stays where it is, with the table after it
refusalMissing, malformed or out-of-range size
| Size | Outcome |
|---|---|
| none | no edit is produced |
| "3" | no edit is produced |
| "0x3" | no edit is produced |
| "3x10" | no edit is produced |
| "axb" | no edit is produced |
boundaryWhere the Table action is offered
| Palette mode or editor | Outcome |
|---|---|
| a block editor | Table is offered |
| a cell editor open, cell formatting group | Table is not offered (the scopes of the action are ["block"]) |
| a cell editor open, its slash menu | Table is not among the entries, while Emoji is |
| strict mode | Table |
| GFM mode | Table, HTML table and Column alignment; Table with caption, List table and Pipe table are not offered |
| MyST mode | all six: Table, HTML table, Column alignment, Table with caption, List table and Pipe table |