Tables are among the most essential elements in 4D Write Pro documents. 4D v20 R2 brings a new improvement to help you better organise and present information within tables. Say hello to the possibility of merging cells!
No matter how you use the tables, whether they are filled in automatically or manually, the ability to merge cells will undoubtedly help you. Here is a sample of what can easily be done now!
Horizontally, vertically… or both
The cells of the tables can be merged horizontally on all or part of a row or vertically on all or part of a column. It is also possible to create blocks of cells… the possibilities are endless, and you will have the freedom to let your creativity run free.
INTERFACE OR PROGRAMMING?
As usual, there are several choices. Let’s see them in detail.
What’s new in the interface
Two buttons are now available in the toolbar, as well as two menu items in the cells button menu in both interfaces (toolbar and sidebar)
These menu items are contextual and will only appear if several cells are selected in a table. The first one allows merging cells horizontally, vertically, or by block. The second one has the opposite effect and will create as many cells as needed, not merged, in place of the selected cell(s). This menu item is only active if at least one merged cell is selected.
New standard actionS
Two standard actions are available: “cell/merge” and “cell/split”.
use as button standard actions
- cell/merge
- cell/split
Use as menu items
APPEND MENU ITEM($menu; ak standard action title)
SET MENU ITEM PROPERTY($menu; -1; Associated standard action; "cell/merge")
APPEND MENU ITEM($menu; ak standard action title)
SET MENU ITEM PROPERTY($menu; -1; Associated standard action; "cell/split")
NEW commands for merging and splitting
Finally, two new dedicated commands have been created so that you can define, for each table you create, how their cells should be arranged.
The first one, WP TABLE MERGE CELLS, allows to merge of cells and follows the same logic as the standard actions. It receives a range (of cells, columns, or rows) in a parameter or a table and cell coordinates.
Using a range
$cells:=WP Table get cells($table; 3; 2; 2; 4)
WP TABLE MERGE CELLS($cells)
Using a table
WP TABLE MERGE CELLS($table; 3; 2; 2; 4)
The second (WP TABLE SPLIT CELLS) has the opposite effect and applies equally to a range (of cells, columns, or rows) or a table.
Using a range
$cell:=WP Table get cells($table; 3; 2; 1; 1)
WP TABLE SPLIT CELLS($cell)
Using a table
WP TABLE SPLIT CELLS($table; 3; 2 {; 1; 1})
Conclusion
We are delighted to offer you this new feature, requested by some of you and which we hope will be helpful to all!
Don’t hesitate to give us your feedback via the forum!