Skip to main content
Version: Next

WP Table range

WP Table range ( targetObj ) -> Function result

ParameterTypeDescription
targetObjObject🡒Range or element or 4D Write Pro document
Function resultObject🡐Range object containing tables only

Compatibility

WP Table range was named WP Create table range in previous versions of 4D Write Pro. It has been renamed for clarity.

Description

The WP Table range command returns a range object that addresses only the tables that intersect with the targetObj you passed as parameter. It will return a range of the wk type table, even if the targetObj you passed as parameter does not contain a table. The table range object returned can be used by WP GET ATTRIBUTES and WP SET ATTRIBUTES to handle attributes that apply to tables and table contents.

In the targetObj parameter, you can pass:

  • a range, or
  • an element (body / header / footer / paragraph / section / subsection), or
  • a 4D Write Pro document

Example

You want to modify the look of the tables contained in the table range:

 tableRange:=WP Table range(myDoc)
  //table attributes
 WP SET ATTRIBUTES(tableRange;wk border style;wk solid;wk border color;"Blue";wk border width;"3px")
 WP SET ATTRIBUTES(tableRange;wk table align;wk center)
  //text attributes   
 WP SET ATTRIBUTES(tableRange;wk font size;12)
 WP SET ATTRIBUTES(tableRange;wk text transform;wk capitalize)
 WP SET ATTRIBUTES(tableRange;wk font bold;wk true)

See also

WP Get elements
WP Text range