WP TABLE DELETE COLUMNS
WP TABLE DELETE COLUMNS ( targetObj ) | ( tableRef ; colNumber {; numColumns} )
Parameter | Type | Description | |
---|---|---|---|
targetObj | Object | → | Range or element or 4D Write Pro document |
tableRef | Object | → | Table reference |
colNumber | Integer | → | Column number |
numColumns | Integer | → | Number of columns to delete (default value = 1) |
Description
The WP TABLE DELETE COLUMNS command removes one or several column(s) from a 4D Write table.
This command supports two syntaxes:
- If you pass a targetObj as the first parameter, the command will remove all of the columns in table(s) intersecting the target. targetObj can contain:
- a range, or
- an element (row / paragraph / body / header / footer / inline picture / section / subsection), or
- a 4D Write Pro document.
With this syntax, the numColumns parameter (if passed) is ignored. - If you pass both a tableRef and a colNumber, the command will remove the column(s) in the designated table, starting at the specified column index.
With this syntax, the optional numColumns parameter defines the number of columns to remove from tableRef. By default, if this parameter is omitted, one column is removed.
Removing all columns of a table will remove the entire table.
Example
You want to delete one column from the Invoice table. This code:
var $table : Object
$table:=WP Get element by ID(WParea;"Invoice") //retrieve "Invoice" table
WP TABLE DELETE COLUMNS($table;2;1) //remove the second column
Will remove the column from the correct location: