The table control provides the key functionality of Sfairadora – manipulation with the Table data type. A table is a sequence of rows whose number may vary. Every row has a fixed structure – it consists of elements that constitute columns of the table. The element type of every column is determined by the table definition. Nevertheless, there is no limitation as to what type it should be. In addition to the usual simple types, such as number or text, you can use, for example, another table.

Table Components

At the top of the table, a header containing column names is located. A table filter may be displayed under the column names as part of the header. The contents of the table are displayed under the header. The contents of the table consist of rows. Every row has a row label on the left showing the respective row number. The label is followed by a sequence of cells. Cells positioned above each other form a column. A table summary may be displayed at the bottom of the table. There are two buttons to the right of the header: one button to show table filter and the other to show table summary.

Working with a Table

For proper understanding of how a table works, it is necessary to distinguish between the concepts of data, view, and presentation.
♦Data refers to records constituting the contents of a table.
♦View is a certain logical arrangement of this data, such as row filtering, addition of computed columns, grouping, etc.
♦Presentation is a particular way of presenting table data (and therefore also a table view) on the screen. A presentation consists of particular controls such as the line editor, etc.
Every table has all these levels. If you create a table in the Data document section, its contents are stored in this section. Sfairadora automatically creates a presentation for this data table in the form of a table control (discussed in this chapter). The table control creates a local view as a mediating level between the presentation and the actual data, which initially merely reflects the data table structure, but allows the user, for example, to sort the records or to filter some of them out without altering or destroying the actual stored data. In a different situation the table may be created in the View document section and Sfairadora then automatically creates a presentation based on the structure of the view; the view, as a middle level, is not internally stored in the table control, but rather in the View document section, whereas the actual contents of the table (data) are stored in the Data document section.
Operations that can be performed on a table can be divided into two main groups. Operations of the first kind change only the contents of the table (inserting rows, etc.) and its appearance (displaying and hiding columns, etc.). These operations can be performed on any table. Operations of the other kind change the definition of the table presentation, the definition of the table view, or the type (structure) of the data. This other group of operations can be performed only on tables that edit records in the Data or View document sections or on tables that have their own definition in the Presentation section. These operations present a simplified technique to edit the Data type, View type, or Presentation definition. Modifications of a table view present a specific situation because if the view is created locally for the table control, then a change of the view is merely a change of the presentation appearance (this applies to automatically created table presentations in the Data section); on the contrary, if a table edits a view explicitly stored in the View section, then a change of the view changes also the definition of a part of the document, so it is more than just a change of the view appearance.
Elementary operations on a table are explained in the following chapters:
Operations on a table view, that is, an analogy to the construction of a database query, are realized by means of the RT-G/U (Recursive Tables – Group/Ungroup) data model. The main techniques are explained in the following chapters:
Manipulation with columns is explained in the following chapters: