12.6.27 Flow Object Classes for Tables
Specification of tabular formatting makes use of the following flow object classes:

•  table,

•  table-part,

•  table-column,

•  table-row,

•  table-cell,

•  table-border.
12.6.27.1 Table Flow Object Class
A table flow object has a single principal port. The contents of this port shall be either:

•  all of class table-part, or

•  all of class table-column, table-row, or table-cell.
If it contains flow objects of class table-column, they shall occur before all flow objects of other classes. A table flow object can only be displayed.
A table has two directions associated with it, a row-progression direction and a column-progression direction.  The row-progression direction is equal to the placement direction of the table flow object.  The column-progression direction is given by the value of the writing-mode: characteristic of the table flow object.  These shall be perpendicular.
A table flow object has the following characteristics:

•  table-width: is a length-spec that specifies the size of the table in the column-progression direction, or, if the table-auto-width feature is used, #f indicating that the width of the table should be the minimum that will accommodate its content. This characteristic is not inherited.  The default value is the display-size less any applicable indent.

•  table-auto-width-method: is #f or a string specifying a public identifier for the method to be used to determine the widths of columns.  This applies only if the table-auto-width feature is present.  The initial value is #f.

•  table-border: is an unlabeled sosofo containing a single table-border flow object.  A value of #t or #f is also allowed; this is equivalent to a table-border with a border-present?: characteristic equal to #t or #f, respectively, and all other characteristics inherited from the table.  This characteristic determines the default value for the before-row-border:, after-row-border:, before-column-border:, and after-column-border: characteristics.  The initial value is #f.

•  before-row-border: is an unlabeled sosofo containing a single table-border flow object to be used as the border on the side of the table that is before the table in the row-progression direction.  A value of #t or #f is also allowed; this is equivalent to a table-border with a border-present?: characteristic equal to #t or #f, respectively, and all other characteristics inherited from the table.  This characteristic is not inherited.  The default value is the value of the table-border: characteristic.

•  after-row-border: is the same as before-row-border: but applies to the side of the table that is after the table in the row-progression direction.

•  before-column-border: is the same as before-row-border: but applies to the side of the table that is before the table in the column-progression direction.

•  after-column-border: is the same as before-row-border: but applies to the side of the table that is after the table in the column-progression direction.

•  table-corner-rounded: specifies whether the corners of the table shall be drawn as quarter circles as follows:

•  #f indicating that no corners shall be rounded.

•  #t indicating that all corners shall be rounded.

•  a list of the symbols identifying the individual corners that shall be rounded; each symbol shall be of the form x-y where x is before or after specifying whether the corner is before or after the table in the column-progression direction and y is before or after specifying whether the corner is before or after the table in the row-progression direction.

The initial value is #f.

•  table-corner-radius: is a length-spec specifying the radius of the quarter circles to be used when table-corner-rounded: is not #f.  A negative value indicates that the center of the circle is at the point where the edges intersect; in this case, the corners shall be concave. The initial value is 3pt.

•  position-preference: is either #f or one of the symbols top or bottom.  This applies if the flow object is directed into a port on a column-set-sequence flow object that is flowed into both the top-float and bottom-float zones of a column-subset and indicates whether the areas from this flow object may be flowed into only one of the zones. This characteristic is not inherited. The default value is #f.

•  display-alignment: is one of the symbols start, center, end, inside, or outside specifying the alignment of the areas resulting from the flow object in the direction of the writing-mode. The initial value is start. This determines how the flow object expands its areas so their size is equal to the display size in the direction perpendicular to the area container's filling-direction.  First space is added to the area so that its size is equal to the display size less the sum of the start and end indents:

•  if the alignment is start, the space is all added at the end in the direction of the writing-mode;

•  if the alignment is end, the space is all added at the start in the direction of the writing-mode;

•  if the alignment is center, the space is added equally at the start and the end in the direction of the writing-mode;

•  if the alignment is inside, then the flow object shall have an ancestor of class page-sequence, the direction of the writing-mode shall be perpendicular to the binding-edge: of the page-sequence, and the space shall be added on the edge that is outside with respect to the spread;

•  if the alignment is outside, then the flow object shall have an ancestor of class page-sequence, the direction determined by the writing-mode shall be perpendicular to the binding-edge: of the page-sequence, and the space shall be added on the edge that is inside with respect to the spread.

Then an amount of space equal to the start-indent is added at the start in the direction of the writing-mode, and an amount of space equal to the end-indent is added at the end in the direction of the writing-mode.

•  start-indent: is a length-spec specifying the indent for the edge of the area at the start in the direction of the writing-mode. The initial value is 0pt.

•  end-indent: is a length-spec specifying the indent for the edge of the area at the end in the direction of the writing-mode. The initial value is 0pt.

•  writing-mode: is one of the symbols left-to-right, right-to-left, or top-to-bottom.  The direction determined by the writing-mode shall be perpendicular to the placement direction.  The initial value is left-to-right.

•  span: is a strictly positive integer specifying the number of columns that the areas resulting from this flow object shall span. This characteristic shall apply if the flow object is directed into a port on a column-set-sequence flow object that is flowed into the top-float, bottom-float, or body-text zone of a spannable column-subset.  The initial value is 1.

•  span-weak?: is a boolean specifying whether the areas resulting from this flow object span weakly rather than strongly.  See section 12.6.5.1, Column-set-model.  This characteristic applies if the flow object is directed into a port on a column-set-sequence flow object that is flowed into the top-float, bottom-float, or body-text zone of a spannable column-subset and has a span: characteristic with a value greater than 1.  The initial value is #f.

•  space-before: is an object of type display-space specifying space to be inserted before, in the placement direction, the areas produced by the flow object. This characteristic is not inherited. The default is for no space before to be inserted.

•  space-after: is an object of type display-space specifying space to be inserted after, in the placement direction, the areas produced by the flow object. This characteristic is not inherited. The default is for no space after to be inserted.

•  keep-with-previous?: is a boolean specifying whether the flow object shall be kept in the same area as the previous flow object. This characteristic is not inherited. The default value is #f.

•  keep-with-next?: is a boolean specifying whether the flow object shall be kept in the same area as the next flow object.  This characteristic is not inherited. The default value is #f.

•  break-before: is #f or one of the symbols page, page-region, column, or column-set specifying that the flow object shall start an area of that type. This characteristic is not inherited. The default is #f.

•  break-after: is #f or one of the symbols page, page-region, column, or column-set specifying that the flow object shall end an area of that type. This characteristic is not inherited. The default is #f.

•  keep: is one of the following:

•  #t meaning that the areas produced by this flow object shall be kept together within the smallest possible area.

•  the symbol page indicating that the areas produced by the flow object shall lie within the same page; in this case, the flow object shall have an ancestor flow object of class page-sequence.

•  the symbol column-set indicating that the areas produced by the flow object shall lie within the same column set; in this case, the flow object shall have an ancestor of class column-set-sequence.

•  the symbol column indicating that the areas produced by the flow object shall lie within the same column set, and that the first column that each area spans in the column set shall be the same.

•  #f indicating that this characteristic is to be ignored.

This characteristic is not inherited. The default value is #f.

•  may-violate-keep-before?: is a boolean which, if true, specifies that constraints imposed by the keep: characteristics of ancestor flow objects on the relative positioning of this flow object and its previous flow object may not be respected. This characteristic is not inherited. The default value is #f.

•  may-violate-keep-after?: is a boolean which, if true, specifies that constraints imposed by keep: characteristics of ancestor flow objects on the relative positioning of this flow object and its next flow object may not be respected. This characteristic is not inherited. The default value is #f.
12.6.27.2 Table-part Flow Object Class
A table-part flow object is allowed only within a table flow object. A table-part flow object has three ports:

•  the principal port, which is used for the table body.

•  header, which is used for the table header.

•  footer, which is used for the table footer.
The flow objects that are allowed in the ports of a table-part flow object shall be only those explicitly specified herein. Flow objects of class table-column are allowed in the principal port; they shall occur before flow objects of any other class. All ports shall accept flow objects of class table-row and table-cell.
The result of formatting a table-part flow object is a sequence of areas.  Each area consists of the content of the header port (unless omitted because of the table-part-omit-middle-header?: characteristic), followed by some portion of the content of the principal port, followed by the content of the footer port (unless omitted because of the table-part-omit-middle-footer?: characteristic).  Each row in the principal port occurs exactly once, and the order of the rows shall be preserved.  The rows in the header and footer ports shall be replicated for each result area.
All table-parts in a table have the same width.
The following characteristics are applicable:

•  table-part-omit-middle-header?: is a boolean which if true specifies that a table-part whose first area is not at the beginning of an area produced by the table shall not start with the content of its header port.  The initial value is #f.

•  table-part-omit-middle-footer?: is a boolean which if true specifies that a table-part whose last area is not at the end of an area produced by the table shall not end with the content of its footer port.  The initial value is #f.

•  space-before: is an object of type display-space specifying space to be inserted before, in the placement direction, the areas produced by the flow object. This characteristic is not inherited. The default is for no space before to be inserted.

•  space-after: is an object of type display-space specifying space to be inserted after, in the placement direction, the areas produced by the flow object. This characteristic is not inherited. The default is for no space after to be inserted.

•  keep-with-previous?: is a boolean specifying whether the flow object shall be kept in the same area as the previous flow object. This characteristic is not inherited. The default value is #f.

•  keep-with-next?: is a boolean specifying whether the flow object shall be kept in the same area as the next flow object.  This characteristic is not inherited. The default value is #f.

•  break-before: is #f or one of the symbols page, page-region, column, or column-set specifying that the flow object shall start an area of that type. This characteristic is not inherited. The default is #f.

•  break-after: is #f or one of the symbols page, page-region, column, or column-set specifying that the flow object shall end an area of that type. This characteristic is not inherited. The default is #f.

•  keep: is one of the following:

•  #t meaning that the areas produced by this flow object shall be kept together within the smallest possible area.

•  the symbol page indicating that the areas produced by the flow object shall lie within the same page; in this case, the flow object shall have an ancestor flow object of class page-sequence.

•  the symbol column-set indicating that the areas produced by the flow object shall lie within the same column set; in this case, the flow object shall have an ancestor of class column-set-sequence.

•  the symbol column indicating that the areas produced by the flow object shall lie within the same column set, and that the first column that each area spans in the column set shall be the same.

•  #f indicating that this characteristic is to be ignored.

This characteristic is not inherited. The default value is #f.

•  may-violate-keep-before?: is a boolean which, if true, specifies that constraints imposed by the keep: characteristics of ancestor flow objects on the relative positioning of this flow object and its previous flow object may not be respected. This characteristic is not inherited. The default value is #f.

•  may-violate-keep-after?: is a boolean which, if true, specifies that constraints imposed by keep: characteristics of ancestor flow objects on the relative positioning of this flow object and its next flow object may not be respected. This characteristic is not inherited. The default value is #f.
12.6.27.3 Table-column flow object
A table-column flow object is an atomic flow object that specifies characteristics applicable to table-cells that have the same column and span.
It has the following characteristics:

•  column-number: is a strictly positive integer specifying the column number of the table-cells that are to inherit their characteristics from this table-column flow object. The default is 1 plus the column-number: of the previous table-column flow object, if there is a previous table-column, and otherwise 1. This characteristic is not inherited.

•  n-columns-spanned: is a strictly positive integer specifying the number of columns spanned by table-cells that are to inherit their characteristics from this table-column flow object. This characteristic is not inherited. The default value is 1.

•  width: is a length-spec specifying the width of this column. This characteristic is not inherited. This characteristic shall not be specified for table-column flow objects for which the n-columns-spanned: characteristic is greater than 1. The width: characteristic shall be specified for every column unless the table-auto-width feature is present.

•  display-alignment: is one of the symbols start, center, end, inside, or outside specifying the alignment of the areas resulting from the flow object in the direction of the writing-mode. The initial value is start. This determines how the flow object expands its areas so their size is equal to the display size in the direction perpendicular to the area container's filling-direction.  First space is added to the area so that its size is equal to the display size less the sum of the start and end indents:

•  if the alignment is start, the space is all added at the end in the direction of the writing-mode;

•  if the alignment is end, the space is all added at the start in the direction of the writing-mode;

•  if the alignment is center, the space is added equally at the start and the end in the direction of the writing-mode;

•  if the alignment is inside, then the flow object shall have an ancestor of class page-sequence, the direction of the writing-mode shall be perpendicular to the binding-edge: of the page-sequence, and the space shall be added on the edge that is outside with respect to the spread;

•  if the alignment is outside, then the flow object shall have an ancestor of class page-sequence, the direction determined by the writing-mode shall be perpendicular to the binding-edge: of the page-sequence, and the space shall be added on the edge that is inside with respect to the spread.

Then an amount of space equal to the start-indent is added at the start in the direction of the writing-mode, and an amount of space equal to the end-indent is added at the end in the direction of the writing-mode. This is used for aligning the first line of each externally aligned paragraph in the column.

•  start-indent: is a length-spec specifying the indent for the edge of the area at the start in the direction of the writing-mode. The initial value is 0pt. This is used for aligning the first line of each externally aligned paragraph in the column.

•  end-indent: is a length-spec specifying the indent for the edge of the area at the end in the direction of the writing-mode. The initial value is 0pt. This is used for aligning the first line of each externally aligned paragraph in the column.
Any inherited characteristic that is specified on a table-column flow object may be inherited by table-cells (or indirectly by the content of table-cells) as described in section 12.4, Flow Object Tree Construction.
If the table-auto-width feature is not enabled, the number of columns in a table-part or in a table that contains no table-parts is determined by the table-column flow objects in its principal port.  For every cell in the content, and for every column spanned by that cell, there shall be a table-column flow object whose column-number is equal to the number of that column.  If the table-auto-width feature is enabled, then the number of columns is determined automatically from the content of the table.
(table-unit k)
Returns a length-spec that specifies k units of proportional measure.  This may be used in the value of the width: characteristic.  The value of a unit of proportional measure for a particular table is chosen so that the total width of the columns is equal to the specified width of the table.

NOTE 112

This allows the width of a column to be specified proportionally.
12.6.27.4 Automatic Table-width Computation
This clause applies when the table-auto-width feature is enabled.
The width of a column for which no width is specified shall be at least as great as the maximum of the minimum possible widths of the content of any table-cells that span exactly that column.

NOTE 113

When a table-cell includes a paragraph for which the lines: characteristic has a value of wrap, the minimum possible width of that paragraph is determined in a system-dependent manner.  It might, for example, be the length of the longest word.
If a table-cell spans more than one column, then the sum of the widths of the columns that it spans shall be at least as great as the width of the content of the table-cell.
If a length-spec is specified for a column's width, then the column shall be exactly that wide, and that length shall be used as the display-size for any table-cells which span exactly that column.
Other aspects of the width computation method can be controlled with the table-auto-width-method: characteristic.
12.6.27.5 Table-row Flow Object Class
A table-row flow object serves to group table-cells into rows: all table-cells in a table-row start in the same geometric row.
A table-row has a single principal port, which accepts flow objects of class table-cell.
A table-row flow object can only occur as the child of a table-part or table flow object.
When flow objects of class table-cell occur directly in a table-part or table, then cells are grouped into rows using the starts-row?: and ends-row?: characteristics.
12.6.27.6 Table-cell Flow Object Class
A table-cell has a single principal port. It shall accept any flow object that can be displayed. A table-cell flow object shall only occur as the child of a table-row, table-part, or table flow object.
A table-cell has the following characteristics:

•  column-number: is a strictly positive integer specifying the number of the first column to be spanned by this table-cell.  This characteristic is not inherited. The default value is the current column-number. For the first table-cell in a table-row, the current column-number is 1. For other table-cells, the current column-number is the column-number of the previous table-cell in the row plus the number of columns spanned by that previous table-cell.

NOTE 114

When an earlier table-row has table-cells that span more than one row, then table-cells in subsequent table-rows shall use the column-number: characteristic to avoid conflict.

•  n-columns-spanned: is a strictly positive integer specifying the number of columns which this cell spans in the column-progression direction starting with the current column.  This characteristic is not inherited.  The default value is 1.

•  n-rows-spanned: is a strictly positive integer specifying the number of rows which this cell spans in the row-progression direction starting with the current row.  This characteristic is not inherited.  The default value is 1.

•  cell-before-row-margin: is a length giving the margin before the row in row-progression direction. The initial value is 0pt.

•  cell-after-row-margin: is a length giving the margin after the row in row-progression direction. The initial value is 0pt.

•  cell-before-column-margin: is a length giving the margin before the column in column-progression direction.  The initial value is 0pt. The display-size for the content of the cell is equal to the width of the cell less the sum of the cell-before-column-margin: and cell-after-column-margin: characteristics.

•  cell-after-column-margin: is a length giving the margin after the column in the column-progression direction. The initial value is 0pt.

•  cell-row-alignment: is one of the symbols start, end, or center specifying the alignment of the content of the cell in the row-progression direction. The initial value is start.

•  cell-background?: is a boolean specifying whether the cell has a solid background.  If it does, then the background-color: characteristic specifies the color to be used for the background. The initial value is #f.

•  background-color: is either #f or an object of type color that specifies the color in which the marks for the flow object's background should be made. The initial value is #f. This applies only if the cell-background?: characteristic is true.

•  background-layer: is an integer specifying the layer of the marks of the areas resulting from the background of a flow object. The initial value is -1. This applies only if the cell-background?: characteristic is true.

•  cell-before-row-border: is an unlabeled sosofo containing a single table-border flow object to be used as the border on the side of the table that is before the cell in the row-progression direction. A value of #t or #f is also allowed; this is equivalent to a table-border with a border-present?: characteristic equal to #t or #f, respectively, with all other characteristics inherited from the table-cell. The initial value is #f.

•  cell-after-row-border: is the same as cell-before-row-border: but applies to the side of the cell that is after the cell in the row-progression direction.

•  cell-before-column-border: is the same as cell-before-row-border: but applies to the side of the cell that is before the cell in the column-progression direction.

•  cell-after-column-border: is the same as cell-before-row-border: but applies to the side of the cell that is after the cell in the column-progression direction.

•  starts-row?: is a boolean specifying whether this cell starts a row.  This is allowed only for table-cells that are not in table-rows. The default value is #f.  This characteristic is not inherited.  A cell that is not part of a table-row will start a row if the starts-row?: characteristic is true, or if there is no previous flow object, or if the previous flow object is not a table-cell, or if the previous flow object is a table-cell with the ends-row?: characteristic true.

•  ends-row?: is a boolean specifying whether this cell ends a row.  This is allowed only for table-cells that are not in table-rows. The default value is #f.  This characteristic is not inherited.

•  cell-crossed: is either #f or one of the following symbols:

•  with specifying that a single diagonal line shall be drawn through the cell from the corner that is first in both the row- and column-progression directions to the diagonally opposite corner.

•  against specifying that a single diagonal line shall be drawn from the corner that is first in the row-progression direction and last in the column-progression direction to the diagonally opposite corner.

•  both specifying that a pair of lines shall be drawn through the cell from each corner to the diagonally opposite corner.

The initial value is #f. The appearance of the lines is determined by the values of the following line characteristics for the table-cell.

•  line-cap: is one of the symbols butt, round, or square specifying the cap style for the line. The initial value is butt. This applies to the lines drawn when the cell-crossed: characteristic is true.

•  line-dash: is a list of one or more lengths that specifies the dash pattern of the line.  The first length specifies the number component of the CurrentDashPattern graphics state variable in ISO/IEC 10180.  The remaining lengths specify the vector component of the CurrentDashPattern graphics state variable. The initial value is a list containing the length 0pt. This applies to the lines drawn when the cell-crossed: characteristic is true.

•  line-thickness: is a length that specifies the thickness of the line or lines. The initial value is 1pt. This applies to the lines drawn when the cell-crossed: characteristic is true.

•  line-repeat: is a strictly positive integer that specifies the number of parallel lines to be drawn.  For example, a value of 2 indicates a double line. The initial value is 1. This applies to the lines drawn when the cell-crossed: characteristic is true.

•  line-sep: is a length that gives the distance between the centers of parallel lines. The initial value is 1pt. This applies to the lines drawn when the cell-crossed: characteristic is true.

•  float-out-sidelines?: is a boolean which if true specifies that sideline attachments on the content of a cell shall be detached from the cell and attached to the table instead. The initial value is #f.

•  float-out-marginalia?: is a boolean which if true specifies that marginalia attachments on the content of a cell shall be detached from the cell and attached to the table instead. The initial value is #f.

•  float-out-line-numbers?: is a boolean which if true specifies that line-number attachments on the content of a cell shall be detached from the cell and attached to the table instead. The initial value is #f.

NOTE 115

The alignment of the content of a table-cell in the column-progression direction (e.g., horizontal alignment for left-to-right, top-to-bottom text) shall be controlled by the display-alignment: or quadding: characteristics of the content of the table-cell.
12.6.27.7 Table-border Flow Object Class
A table-border flow object is an atomic flow object used to specify the border of a table-cell or of the table as a whole.  A table-border flow object is not allowed in the content of any flow object. The following characteristics are applicable:

•  border-priority: is an integer that determines how conflicts between border specifications are resolved.  When there are two table-border flow objects that apply to a particular segment of a border, then the one that has the larger priority shall be used.  It shall be an error if there are two such table-borders that have the same priority but are not identical.  The initial value is 0.

NOTE 116

This characteristic resolves conflicts between the specification of the border of the table and the specification of the border of cells as well as between the specifications of the borders of adjacent cells.

•  border-alignment: is a symbol specifying the alignment of the border's line relative to the position of the border, as follows:

•  center specifying that the line shall be centered with respect to the position of the border.

•  start specifying that the edge of the line that is the starting edge in the row- or column-progression direction shall be aligned with the position of the border.

•  end specifying that the edge of the line that is the ending edge in the row- or column-progression direction shall be aligned with the position of the border.

•  outside specifying that the edge of the line that is an outer edge of the table shall be aligned with the position of the border. This is allowed only for borders that are at the edge of the table.

•  inside specifying that the edge of the line that is not the outer edge of the table shall be aligned with the position of the border.  This is allowed only for borders that are at the edge of the table.

The initial value is center.

•  border-present?: is a boolean specifying whether the border shall be present. The initial value is #t.

•  border-omit-at-break?: is a boolean specifying whether this border shall be omitted if adjacent to a break in the table.  A border shall be omitted if either this characteristic or the border-present?: characteristic is #f. This is applicable only to borders that are parallel to the row-progression direction. The initial value is #f.

•  color: is an object of type color that specifies the color in which the flow object's marks should be made. The initial value is the default color in the Device Gray color space.

•  layer: is an integer specifying the layer of the marks of the areas resulting from the flow object.  An area shall be imaged after any area whose layer has a lower value. The initial value is 0.

•  line-cap: is one of the symbols butt, round, or square specifying the cap style for the line. The initial value is butt.

•  line-dash: is a list of one or more lengths that specifies the dash pattern of the line.  The first length specifies the number component of the CurrentDashPattern graphics state variable in ISO/IEC 10180.  The remaining lengths specify the vector component of the CurrentDashPattern graphics state variable. The initial value is a list containing the length 0pt.

•  line-thickness: is a length that specifies the thickness of the line or lines. The initial value is 1pt.

•  line-repeat: is a strictly positive integer that specifies the number of parallel lines to be drawn.  For example, a value of 2 indicates a double line. The initial value is 1.

•  line-sep: is a length that gives the distance between the centers of parallel lines. The initial value is 1pt.

•  line-miter-limit: is a number that specifies the miter limit for line joins. The semantics of the miter limit are described in ISO/IEC 10180. The initial value is 10.

•  line-join: is one of the symbols miter, round, or bevel specifying the join style of the line. The initial value is miter.
The width of borders does not affect the width of cells, nor the positioning of the contents of cells, nor the width of the table, nor the size of the area produced by the table.  In particular, the width of the table, as specified by the table-width: characteristic on the table, is equal to the sum of the widths of the cells.