Divide Table

The Divide Table action is a loop action capable of dividing a table into one or more sub-tables. The Divide Table action searches the rows in a table to find one or more dividers and then splits the table into several sub tables based on these dividers. A row is a divider if at least one of the specified criteria is satisfied.

Properties

The Divide Table action can be configured using the following properties.

Divide at Rows Matching this Pattern:
In this field a pattern can be entered. A table row that matches the pattern is considered a divider and will cause the creation of a new table. Note that the pattern must match the entire row.
Divide at Rows Not Matching this Pattern:
In this field a pattern can be entered. A table row that does not match the pattern is considered a divider and will cause the creation of a new table. Note that the pattern must match the entire row to prevent the row from becoming a divider.
Include This in Row Matching:
Specifies what should be included from a row when matching against the pattern.
Ignore Case in Row Matching:
Specifies whether case should be ignored during row matching. Check this property if case should be ignored.
Divide at Rows with Min. No. of Columns and Divide at Rows with Max. No. of Columns:
These properties specify an interval for the number of table columns in a row. If the number of columns in a row is within the interval the row is considered a divider, thus resulting in a new table.
First Sub Table Number:
The number of the first sub table to loop from. The number can be specified to count either forward from the first sub table, or backwards from the last sub table.
Last Sub Table Number:
The number of the last sub table to loop to. The number can be specified to count either forward from the first sub table, or backwards from the last sub table.
Place Divider Row in Table Header:
If this property is checked then the located divider row will be placed inside a <thead>-tag of the sub table. If it is not checked then the divider is kept as in the sub table.

This property does not apply when dividing tags in XML documents.

Examples

Assume the found tag looks like this:

<table>
  <tbody>
    <tr>
      <th> Model </th>
      <th> Description </th>
      <th> Price </th>
    </tr>
    <tr>
      <td> XXX </td>
      <td> New Model </td>
      <td> 200 </td>
    </tr>
    <tr>
      <th> Model </th>
      <th> Description </th>
      <th> Price </th>
    </tr>
    <tr>
      <td> YYY </td>
      <td> Old Model </td>
      <td> 100.5 </td>
    </tr>
  </tbody>
</table>

If the Divide at Rows Matching this Pattern property is set to ".*descript.*" and the Place Divider Row in Table Header property is not checked, the output in the first iteration will be:

<table>
  <tbody>
    <tr>
      <th> Model </th>
      <th> Description </th>
      <th> Price </th>
    </tr>
    <tr>
      <td> XXX </td>
      <td> New Model </td>
      <td> 200 </td>
    </tr>
  </tbody>
</table>

and in the second iteration:

<table>
  <tbody>
    <tr>
      <th> Model </th>
      <th> Description </th>
      <th> Price </th>
    </tr>
    <tr>
      <td> YYY </td>
      <td> Old Model </td>
      <td> 100.5 </td>
    </tr>
  </tbody>
</table>