HTML Table Designer

The HTML Table Designer is a user interface that allows you to integrate HTML tables in OpenSpan solutions. You activate it through the Interrogation Form.

Select the HTML Table Designer option and then drag the target icon over the table you want to include in your solution. OpenSpan Studio will then open the HTML Table Designer for the selected table. Use the HTML Table Designer to establish matching criteria for the table and create a table schema. The table schema shows the relationships between heading rows, data rows, and table sections. When you complete the table schema in the HTML Table Designer, the table objects are incorporated into the solution and appear in Object Explorer for use in the solution.

 

Using the HTML Table Designer

When you first open a table in the HTML Table Designer, it appears as shown in the sample image below (table interrogated at http://training.OpenSpan.com/product_list1.html):

You define a table in terms of match cells, data cells, and table sections. Match cells are table cells that remain constant during the use of the table. Examples of match cells are those in a Heading row of a table. Data cells contain the information displayed in the rows of the table with entries that vary according to the row and column chosen in the HTML table. A table section contains a set of repeating data cells.

Begin defining the table schema by designating a set of match cells. Click and drag the mouse through the match cells to select them and then right-click to displays this menu:

 

Possible Errors Interrogating Long Tables

The Enable Lookahead Matching property asserts whether a match is possible – the property is necessary to match something not followed by another of the same thing, such as a table cell. In practical terms, suppose you're interrogating a long HTML table with a footer that looks like a data row. Set the Enable LookAhead Matching property to True to properly match the complete table.

Note: If the LookAhead and EnableMatchInProcess properties are set to True for a long HTML table, Internet Explorer may generate the error "A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?" This problem is due to Internet Explorer and not OpenSpan, but can be disconcerting. An acceptable workaround is to continue clicking No. The code is not stuck, nor is there an infinite recursion. Rather, LookAhead continues the InProcess matching for the table.

 

Match Cells

Select the Define Match Cells option for the highlighted cells. The HTML Table Designer will then show these cells in the table schema at left. An example of the HTML Table Designer where the first, heading row of a table was used as the match cells is shown below:

 

Data Cells

An example of the HTML Table Designer where the second row of a table was designated as data cells is shown below:

 

Table Sections

A table section is used to identify any repeating cells in the table. When you select a table section, you are shown which cells will be included in the section by gray shading of the cells. You are given the options to Apply Changes: Defines the Table Section, or Cancel Changes: Does not Define the Table Section. In the following example, the data cell selected in the second row of the table are designated as a table section. Note that the section applies to the rest of the rows in the table. Sections will apply to any undefined cells between match cells.

 

HTML Table Designer Functions

The HTML Table Designer contains function buttons at the top of the Designer. These buttons let you do the following:

Button

Description

Save Table Schema.

Undo last command.

Redo last command.

Define Match Cells.

Define Data Cells.

Define Table Section.

Remove Cells from Schema.

Remove Rows from Schema.

Remove Table Section from Schema.

Refresh Matching.

 

HTML Table Schema Properties

The grid below shows an example of Properties available for a Match Cell. Match Cell and Data Cell properties are identical.

Definitions of these properties follow:

Name

Description

(Name)

Shows the name of the cell. You can change the name of the cell.

Column

Shows the current column in which the cell is located.

Expected ColSpan

Determines the number of columns the cell spans. For example, a setting of two would mean that the cell spanned two columns. This feature may be set to True or False, along with a minimum or maximum width.

Expected RowSpan

Determines the number of rows the cell spans. For example, a setting of two would mean that the cell spanned two rows. This feature may be set to True or False, along with a minimum or maximum height.

Expected Text

Displays the text displayed in the cell.

Match Settings

Allows you to designate the cell match by Escape (True or False), IgnoreCase (True or False), Mode (Simple or Regex)

Optional

Lists whether or not the cell is optional.

 

Naming

Note: If you change the name of the table in the HTML Table Designer, it will manifest itself in Object Explorer in OpenSpan Studio. However, if you change the name in Object Explorer, it will not be changed in the HTML Table Designer.

 

Refresh Matching

The Refresh Matching button rematches the entire table against a defined schema. This is normally not useful when defining a schema for a table for the first time, but may be required when debugging matching on a table that doesn't quite match the defined schema. Refresh Matching can be performed at any time, except when you have unapplied changes to be made to a table section. Refresh Matching also has a shortcut of F5.

To use the Refresh Schema button, you must Start Interrogation on the Data Table object in Object Explorer.

Once you have selected this, you must select Debug Matching in the Interrogation Form and interrogate the table for which you wish to refresh the Table Matching. Alter the data tables as necessary to match the original schema and then press the Refresh Matching button. For example, if one of the headers was misspelled "Steak" instead of "Streak," correcting this mistake will allow you to rematch the schema for the table. Make sure you save any changes once made.

 

Queries

When conducting a search on the data from an interrogated HTML table, OpenSpan Studio uses the .NET DataTable component to perform a query. Acceptable queries are dictated by what Microsoft has supported by the control. Details on the supported syntax found here.