1. Statement of the problem
Interactive Document Composition for Tables, Illustrations
Build an interactive WYSIWYG table formatter.
Use grid systems to define the layout of tables and pages.
Define a framework for specifying both layout and style rules.
Present some layout algorithms:
Determine a grid layout from the table content and its alignment relationships.
Accept a previously defined grid layout and present the table.
Adjust a grid layout to achieve feasible solution to unsatisfied alignment or size constraints (on column width, say)
Why are tables hard?
Tables has two dimensional alignment relationships (rows and columns)
In galleys, text words become lines and lines become pages. Constraint is line length and H&J algorithms break lines appropriately.
In tables, text words become table entries, entries are aligned simultaneously into rows and columns. Constraints are page width and entry alignment both horizontally and vertically.
Table entries may flow from one to another (especially when treating free form grid designs as a table, where pictures and captions are placed on a grid and text flowed around those elements).
Typeset tables require fine resolution in placement.
Spreadsheets have it easy with a matrix format.
Typewriters have it easy with fixed width characters and fixed escapments for tab stops.
Typesetters have variable width fonts on various fine resolutions (e.g. 1/10th of a point or 1/720 of an inch).
block of type model: treat table entry as an area, furniture in layout
[Seybold, Fundamentals of Photocomposition, p 14]
Row and column alignment:
Align table entries within its row or column.
Headings may span several rows or columns.
Equally spaced rows or columns independent of content.
Foldable columns (or sets of columns) continued in adjacent columns and balanced.
Alignment choices:
Horizontal alignment: flush left, flush right, center, align on character (for example, decimal point)
Vertical alignment: flush top, flush bottom, top baseline, bottom baseline, center, center on top baseline, center on bottom baseline
Style treatment of tables may be grouped:
Table may have different type attributes than surrounding text.
A row or column may be distinguished with different type attributes.
A table entry may have different attributes.
A table entry might contain any text or illustration permissible by the formatter.
Whitespace allowances:
Bearoff distances above, below, to left, to right of table entry.
Intrusions permitted for footnote marks or glosses.
Rules and decorations:
Rules along row or column boundaries
Rule patterns, such as double rules, thick-thin pairs, etc.
Various weights and patterns or rules or borders
Background tints for table entries or whole rows or columns.
Rules within boxes, for example, for total of a column of entries.
Braces to group entries in a column
Leaders (the dots that lead your eye):
Leaders may be replicated characters or rules.
Congruence which arranges that replication pattern aligns. Congruence of several different sizes of leaders.
Leaders run from one column into another and possible across several columns.
Footnotes within tables:
Footnote may be included with table entry, if the entry is large.
Footnotes may be collected at the bottom of the table, outside the table layout but within the space allocated in the page layout.
Footnotes at the bottom of the same page (?) as the table formatting. That is the footnotes are continued in the stream of footnotes within the text. (Sounds a bit hokey to me.)
Special treatments to make a table fit.
Rotate headings to typeset vertically to reduce column width. Possibly set text vertically with characters horizontally (vertical stack arrangement).
Reduce size of type within table.
Reduce whitespace bearoff to make table fit.
Tables may be larger than a single page:
Wide tables may be printed broadside, rotated 90 degrees (either way), so the long table dimension is along the long paper dimension.
Tables may be laid out as facing pages in a two-page spread.
Tables may be printed on fold-out pages for special circumstances.
Tables may be continued on several subsequent pages.
Boxheads (set of column headings) or Stubs (set of row headings) may need to be repeated if table is continued. Continued headings (add the text "continued") may be necessary for such tables.
Readability concerns are well known to those who make mathematical tables.
Grouping rows or columns by adding whitespace or rules every so many entries.
Provide eye guides, for example, thin rules between rows, thick rules every fifth row, background tints every so many rows.
Various sources of tabular materical:
Financial spreadsheets from calculator program.
Financial reports.
Program generates voluminous data.
Extracts from a database.
author composes a simple table.
Unfortunately, almost anything can be a table!