> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Table

> Search tables with the Table element in the FlexiLayout language: column, header, footer, and body parameters, row detection, and multi-page tables.

The **Table** element supports the following parameters in the FlexiLayout language. Use them to configure column, header, footer, and body detection, row splitting, and multi-page tables.

## Column search parameters

| Parameter                                                                                                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void AddHeaderKeyWord( String keyWord, TableBlockColumn column, Real omissionQuality, Logic wholeWordMode, Logic multiLine )`         | Specifies the keyword for the column name. See the **Table** element dialog box, [**Column Properties**](/flexi-capture/fls/tables/column), **Detect by keyword in name** option.                                                                                                                                                                                                                                                                                                                                                   |
| `Void AddHeaderKeyHypothesis( Hypothesis hypothesis, TableBlockColumn column )`                                                        | Specifies the column name by means of the detected hypothesis. See the **Table** element dialog box, [**Column Properties**](/flexi-capture/fls/tables/column), **Use found element as column name** option.                                                                                                                                                                                                                                                                                                                        |
| `Void AddHeaderKeyHypothesis( DistInterval left, DistInterval top, DistInterval right, DistInterval bottom, TableBlockColumn column )` | Specifies the coordinates of the column name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `Void AddColumnType( TableColumnType type, TableBlockColumn column, String regExp )`                                                   | Specifies the column type. The third parameter must only be specified if the column type is a regular expression. See the **Table** element dialog box, [**Column Properties**](/flexi-capture/fls/tables/column), **Type of column content** property.                                                                                                                                                                                                                                                                             |
| `Void ColumnOmissionQuality( Real quality, TableBlockColumn column )`                                                                  | If fixed column orders are used, it sets the penalty for the hypotheses. The coefficient (a number from `0` to `1`) by which the quality of the hypothesis is multiplied if the column specified in the fixed column order is not detected. If the parameter is not set, its default value is `0.9`.                                                                                                                                                                                                                                |
| `Void MissingContentPenalty( Real quality, TableBlockColumn column )`                                                                  | Sets the penalty for the hypotheses. The coefficient (a number from `0` to `1`) by which the quality of the hypothesis is multiplied if the actual data type in the column does not coincide with the data type specified by the user. See the **Table** element dialog box, [**Column Properties**](/flexi-capture/fls/tables/column), **Missing content penalty**. If the parameter is not set, its default value is `0.98`. If column order rules are used, it specifies the penalty for the absence of the column in the table. |
| `Void ColumnBounds( Distance left, Distance right, TableBlockColumn column )`                                                          | Sets the right and left boundaries of the search area used to search for the column. See the **Table** element dialog box, [**Column Properties**](/flexi-capture/fls/tables/column), **Absolute area constraints**.                                                                                                                                                                                                                                                                                                                |
| `Void ExactColumnBorders( XCoordinate left, XCoordinate right, TableBlockColumn )`                                                     | Sets the exact column boundaries. **Note.** This parameter can be used to search for a table where the location of some (or all) of the columns is known in advance.                                                                                                                                                                                                                                                                                                                                                                |

## Column order parameters

| Parameter                                                                       | Description                                                                                                                                                                 |
| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void AddPossibleColumnsOrder( String orderName, TableBlockColumnArray array )` | Specifies one of the variants of fixed column order. See the **Table** element dialog box, [**Order**](/flexi-capture/fls/tables/order) tab, **Fixed column order** option. |
| `Void ColumnsRelation( TableBlockColumnArray )`                                 | Specifies one rule for the column order. See the **Table** element dialog box, [**Order**](/flexi-capture/fls/tables/order) tab, **Rules for column order** option.         |

## Header search parameters

| Parameter                                                                     | Description                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void HasHeader( Logic )`                                                     | Specifies whether FlexiLayout Studio should look for a header. See the **Table** element dialog box, [**Header**](/flexi-capture/fls/tables/header) tab, **Look for header**.                                                                                                                                                                 |
| `Void HeaderOptional( Real q1, Real q2 )`                                     | Specifies whether the header is optional, similarly to the `Void Optional( Real q1, Real q2 )` function for elements.                                                                                                                                                                                                                         |
| `Void HeaderSearchArea( Rect )`                                               | Specifies the search rectangle for the header. If this function is used, the search area of the header is calculated as the intersection of this rectangle and the one enclosing the search area of the whole table. See the **Table** element dialog box, [**Header**](/flexi-capture/fls/tables/header) tab, **Absolute area constraints**. |
| `Void MaxHeaderHypothesesCount( Int )`                                        | Sets the maximum number of hypotheses to be generated during header search. See the **Table** element dialog box, [**Header**](/flexi-capture/fls/tables/header) tab, **Number of hypotheses for header**.                                                                                                                                    |
| `Void MinHeaderKeyElements( Int )`                                            | Sets the minimum number of key elements required to detect the header. The default value is `2`.                                                                                                                                                                                                                                              |
| `Void ExtendHeaderLocalization( XInterval, YInterval, XInterval, YInterval )` | Extends the localization area of the header. For example, it can be used to discard the line of unwanted information located between the header and the body of the table.                                                                                                                                                                    |

## Footer search parameters

| Parameter                                                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void HasFooter( Logic )`                                                   | Specifies whether FlexiLayout Studio should look for the footer. See the **Table** element dialog box, [**Footer**](/flexi-capture/fls/tables/footer) tab, **Look for footer**.                                                                                                                                                                                                                                                       |
| `Void FooterOptional( Real q1, Real q2 )`                                   | Specifies whether the footer is optional, similarly to the `Void Optional( Real q1, Real q2 )` function for elements.                                                                                                                                                                                                                                                                                                                 |
| `Void FooterSearchArea( Rect )`                                             | Specifies the search rectangle for the footer. If this function is used, the footer search area is calculated as the intersection of this rectangle and the one enclosing the search area of the whole table. See the **Table** element dialog box, [**Footer**](/flexi-capture/fls/tables/footer) tab, **Absolute area constraints**.                                                                                                |
| `Void FooterHasTopSeparator()`                                              | Specifies that there is a separator between the footer and the body of the table. The separator can be a part of a table boundary.                                                                                                                                                                                                                                                                                                    |
| `FooterWholeWordMode( Logic )`                                              | This flag is used when looking for a footer based on keywords. If this flag is set to `true`, hypotheses made up of only word parts are discarded. The default setting is `false`. See the **Table** element dialog box, [**Footer**](/flexi-capture/fls/tables/footer) tab, **Whole words only** option.                                                                                                                             |
| `Void FooterNearestToTop( Logic )`                                          | This flag is used when looking for a footer based on keywords. If this flag is set to `true`, FlexiLayout Studio selects the topmost candidate and discards the rest. If this flag is set to `false`, FlexiLayout Studio considers all the possible candidates. The quality of the footer contributes to the quality of the table, and then the table hypothesis with the highest quality is selected. The default setting is `true`. |
| `Void AddFooterKeyWord( String )`                                           | Specifies a keyword for the footer of the table. See the **Table** element dialog box, [**Footer**](/flexi-capture/fls/tables/footer) tab, **Search by keyword** option.                                                                                                                                                                                                                                                              |
| `Void AddFooterKeyHypothesis( Hypothesis )`                                 | Specifies the footer of the table by means of the detected hypothesis. See the **Table** element dialog box, [**Footer**](/flexi-capture/fls/tables/footer) tab, **Use found element** option.                                                                                                                                                                                                                                        |
| `Void AddFooterKeyHypothesis( XInterval, YInterval, XInterval, YInterval )` | Specifies the coordinates of the footer of the table.                                                                                                                                                                                                                                                                                                                                                                                 |

## Body search parameters

| Parameter                               | Description                                                                                                                                                                                               |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void DontFindBody()`                   | Allows skipping the body search. Used for debugging.                                                                                                                                                      |
| `Void BodyOptional( Real q1, Real q2 )` | Specifies whether the body is optional, similarly to the `Void Optional( Real q1, Real q2 )` function for elements.                                                                                       |
| `Void IgnoreVerticalSeparators()`       | Ignores vertical separators in the body of the table when dividing the table into columns. By default, separators are taken into account.                                                                 |
| `Void IgnoreSeparatorsFromHeader()`     | Ignores vertical separators in the header of the table when dividing the table into columns. By default, vertical separators are taken into account.                                                      |
| `Void AutoDetectTopAndBottom( Logic )`  | Searches for the top and bottom boundaries of the table automatically. The default setting is `true`. If the flag is set to `false`, the entire text inside the search area of the table element is used. |

## Row detection parameters

| Parameter                                                                                                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void SingleLineTable( Logic )`                                                                            | Tells FlexiLayout Studio that each line of text must correspond to one row in the table. See the **Table** element dialog box, [**Rows**](/flexi-capture/fls/tables/rows) tab, **One line of text corresponds to one row** check box (if the **Detect rows automatically** option is selected).                                                                                                                                                                                     |
| `Void SingleLineMasterColumn( Logic )`                                                                     | Tells FlexiLayout Studio that each line of text must correspond to one row in the master column of the table. See the **Table** element dialog box, [**Rows**](/flexi-capture/fls/tables/rows) tab, **One line of text corresponds to one row** check box (if the **Use master columns to detect rows** option is selected).                                                                                                                                                        |
| `Void MaxRowVerticalGap( Distance )`                                                                       | Specifies the maximum vertical distance between two rows in the table. If the specified distance is exceeded, this means the end of the body of the table. By default, this distance is not limited.                                                                                                                                                                                                                                                                                |
| `Void MinRowVerticalGap( Distance )`                                                                       | Specifies the minimum vertical distance between two rows in the table. If the distance is smaller than the specified distance, the rows are merged into one. The default value is `0`.                                                                                                                                                                                                                                                                                              |
| `Void MaxMasterColumnRowGap( Distance )`                                                                   | Specifies the maximum vertical distance between two rows in the master column of the table. If the specified distance is exceeded, this means the end of the body of the table. By default, this distance is not limited.                                                                                                                                                                                                                                                           |
| `Void MinMasterColumnRowGap( Distance )`                                                                   | Specifies the minimum vertical distance between two table rows in a particular column. If the distance is smaller than specified, the rows are merged into one. The default distance is `0`.                                                                                                                                                                                                                                                                                        |
| `Void IgnoreHorizontalSeparators()`                                                                        | Ignores horizontal separators when dividing the table into rows.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `Void DivideRowsBySeparators()`                                                                            | Detects rows relying on separators only and ignoring text.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `Void DivideRowsByMasterColumn( TableBlockColumn )`                                                        | Tells FlexiLayout Studio to use the text of the column when dividing the table into rows. This function can be called multiple times. If a table on an image does not have the required column, the column from the next call of the function is used, and so on. If all the columns are unavailable, the rows are detected in the whole table. See the **Table** element dialog box, [**Rows**](/flexi-capture/fls/tables/rows) tab, **Use master columns to detect rows** option. |
| `Void MasterColumnTextAlignment( TextAlignmentInTableCell )`                                               | Specifies text alignment in a table cell in the master column. Can be `TextAlignment_CellTop` or `TextAlignment_CellBottom`. For example, `MasterColumnTextAlignment: TextAlignment_CellBottom;` aligns the text to the bottom border of the cell.                                                                                                                                                                                                                                  |
| `Void AddStopWord( String )`                                                                               | Specifies the words for which separate rows must not be drawn. See the **Table** element dialog box, [**Rows**](/flexi-capture/fls/tables/rows) tab, **Stop words**.                                                                                                                                                                                                                                                                                                                |
| `Void RowSplitters( YCoordinateArray, Logic isBodyTopIncluded = true, Logic isBodyBottomIncluded = true )` | Specifies separators to divide the table into rows. `isBodyTopIncluded == true` specifies the top of the table body, `isBodyBottomIncluded == true` specifies the bottom of the table body, `isBodyTopIncluded == false` detects the top of the table body automatically, and `isBodyBottomIncluded == false` detects the bottom of the table body automatically. Any specified separators outside the table search area are ignored.                                               |

Example for `RowSplitters`:

```text theme={null}
let yArray = RepeatingGroup.AllInstances.GetYArray(1);
RowSplitters( yArray );
```

## Multi-page table parameters

| Parameter                                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Void HeaderOnEachPage( Logic has = true )`                            | Specifies that the table header occurs on every page, at the beginning of each one-page sub-table. See the **Table** element dialog box, [**Header**](/flexi-capture/fls/tables/header) tab, **Header occurs on every page** property.                                                                                                                                                                       |
| `Void AddHeaderKeyHypotheses( HypothesisInstances, TableBlockColumn )` | Specifies a column name on multiple pages by means of a set of hypotheses for a subelement of a repeating group. See the [**Column** element dialog box](/flexi-capture/fls/tables/column), **Use found element as column name** property.                                                                                                                                                                   |
| `Void FooterOnEachPage( Logic has = true )`                            | Specifies that the table footer occurs on every page. See the **Table** element dialog box, [**Footer**](/flexi-capture/fls/tables/footer) tab, **Footer is on every page** property.                                                                                                                                                                                                                        |
| `Void AddFooterKeyHypotheses( HypothesisInstances )`                   | Specifies a table footer on multiple pages by means of a set of hypotheses for a subelement of a repeating group. See the **Table** element dialog box, [**Footer**](/flexi-capture/fls/tables/footer) tab, **Use found element as footer** property.                                                                                                                                                        |
| `Void PreviousInstances( TableHypothesisInstances )`                   | Specifies the previous table instances if the table is inside a repeating group. It is assumed that the direction of instances is top to bottom, column boundaries have no shifts within the same page, and may be slightly shifted horizontally between pages. The previous instances are used to search for or improve the search for columns if the table has no header or if the header is not detected. |
