FOM Reference > Formatting > Tables > fTableCell interface
  
fTableCell interface
Objects of this class represent settings of individual table cells.
CellHorizontalAlignment enumeration
These constants define horizontal alignment of the cell or its contents.
The CellHorizontalAlignment enumeration has the following constants of type DOMString.
ALIGN_LEFT = "nonjustify"
Horizontally left aligned.
ALIGN_NONJUSTIFY = "nonjustify"
Horizontally left aligned.
ALIGN_JUSTIFY = "justify"
Horizontally left aligned and justified.
ALIGN_CENTER = "center"
Horizontally centered.
ALIGN_RIGHT = "right"
Horizontally right aligned.
CellVerticalAlignment enumeration
These constants define vertical alignment of the cell or its contents.
The CellVerticalAlignment enumeration has the following constants of type DOMString.
ALIGN_TOP = "top"
Vertically aligned at the top.
ALIGN_MIDDLE = "middle"
Vertically centered.
ALIGN_CENTER = "center"
Vertically centered.
ALIGN_BOTTOM = "bottom"
Vertically aligned at the bottom.
RuleGutter enumeration
When you have applied cell rules to your table it is possible to make the rule span into the gutter to the right of the cell.
The RuleGutter enumeration has the following constants of type DOMString.
GUTTER_FULL = "full"
Will span rules over the whole right gutter, including fTable::gutterLeft or fTable::gutterRight, respectively.
GUTTER_HALF = "half"
Will make the cell rules span half way into the gutter to the right, including fTable::gutterLeft or fTable::gutterRight, respectively.
GUTTER_SPECIAL = "special"
This will make the cell rule span halfway into normal gutters, but all the way into a right hand gutter that has been specified using fTable::gutterLeft or fTable::gutterRight, respectively. By default cell backgrounds will not obey this unless backgroundSpan is true.
WidthModes enumeration
When columns are being measured, the value of code effects how the width of this cell is taken into account. For every column 3B2 calculates a minimum and a maximum width, which is the maximum of all the cells minimum and maximum widths from that column. Possible values for widthMode are:
The WidthModes enumeration has the following constants of type DOMString.
WIDTH_BIG = "big"
Default value. The maximum width of any lines within the cell are used as the minimum width of the cell.
WIDTH_SMALL = "small"
The longest word within the cell is used as the minimum width of the cell.
WIDTH_WRAP = "wrap"
The cell is allowed to vary in size between its minimum width and its maximum - i.e. between the longest word in the cell and the longest line in the cell.
WIDTH_IGNORE = "ignore"
The width of this cell is ignored when calculating the width of the column. N.B. Using this value is identical to setting widthIgnore = true.
RuleHashWidths enumeration
This allows you to specify a secondary width that the cell rules can use if they include a '#' flag.
The RuleHashWidths enumeration has the following constants of type int.
RULEHASH_NORMAL = 0
Hash rule width is the width of the cell, and ignores any ruleRightGutter and ruleLeftGutter settings.
RULEHASH_LAST_LINE = 1
Hash rule width is the width of the last line in the cell.
RULEHASH_LONGEST_LINE = 2
Hash rule width is the width of the longest line in the cell.
RULEHASH_PREVIOUS_ROW = 3
Uses the hash rule width from the cell in the previous row. This is useful for SGML style tables, where you are not told to underline a row, until after that row has been specified.
absoluteEnd attribute
PI: tbcabsend
This property can be used to control where the reference edge of the cells end indent is measured from. See also indentEnd.
If 0 (the default) the end indent is relative to the cells padding.
If 1 the end indent is relative to the cells margin.
absoluteEnd
Access
read-write
Returns
int
absoluteStart attribute
PI: tbcabsstart
This property can be used to control where the reference edge of the cells start indent is measured from. See also indentStart.
If 0 (the default) the start indent is relative to the cells padding.
If 1 the start indent is relative to the cells margin.
absoluteStart
Access
read-write
Returns
int
alignManual attribute
PI: tbcalignm
Turns on and off the automatic cell alignment.
alignManual
Access
read-write
Returns
boolean
backgroundColor attribute
PI: tbcbgc
The background color for this table cell.
backgroundColor
Access
read-write
Returns
fColor
backgroundHashMode attribute
PI: tbcbghash
If false then backgrounds on a cell will use the normal width of the cell taking into account the backgroundSpan setting. If true then the cell background will use the hash rule width instead - see ruleHashWidth for an explanation.
backgroundHashMode
Access
read-write
Returns
boolean
backgroundSpan attribute
PI: tbcbgsgut
Specifices if background colours should span into table gutters. You can only make the cell background colours span into gutters if you have specified that cell rules span into the right or left gutters (using ruleLeftGutter and ruleRightGutter). Once you have allocated cell background colours, you can make them span into either the left or right gutters. If true, the background colours span into gutters. If false, the background colours will not span into the gutters.
backgroundSpan
Access
read-write
Returns
boolean
boxAbove attribute
PI: tbcabove
When set to an empty string, boxAbove ensures that the current cell stacks above and not below. This is the default behaviour anyway and so it will only be needed if the default cell property for the row has been set to boxBelow. (see later for full description, but basically, its the corresponding command for stacking below).
But setting boxAbove to a non-empty string allows you to modify the default vertical placing of the cell instead of it being calculated automatically. When working out how to stack cells within a boxed row, by default 3B2 examines all the other cells within the row which span the same columns that the current cell spans, and then sits the new cell above the tallest one.
Setting boxAbove to first[,last] lets you specify the range of columns that 3B2 will examine to find the highest cell and then place the current one above it. If last is not specified, it defaults to first. Note the cell itself still sits in the columns designated by formatting.tableCellStart, it just gets its height from the alternative range.
Setting boxAbove to -cellnum lets you specify an explicit cell number within the boxed row from which the current cell will sit above vertically. The cells specified within the boxed row are counted, starting at 1 until cellnum is reached and then the current cell will sit above it.
Note that setting boxAbove to a non-empty string overrides 3B2's automatic behaviour and can give odd results including forcing cells to clash into one another; particularly when using a negative cellnum.
boxAbove
Access
read-write
Returns
String
boxBelow attribute
PI: tbcbelow
Basically boxBelow is the corresponding command to boxAbove but for stacking below existing cells instead of above. When set to an empty string, boxBelow ensures that the current cell stacks below and not above any existing cells. The default behaviour is to stack above so if you want the default cell property for the whole row to be below instead, specify row.defaultCell.below = "".
But setting boxBelowto a non-empty string allows you to modify the default vertical placing of the cell instead of it being calculated automatically. When working out how to stack cells below within a boxed row, by default 3B2 examines all the other cells within the row which span the same columns that the current cell spans, and then sits the new cell below the deepest one.
Setting boxBelow to first[,last] lets you specify the range of columns that 3B2 will examine to find the deepest cell and then place the current one below it. If last is not specified, it defaults to first. Note the cell itself still sits in the columns designated by tableCellStart, it just gets its height from the alternative range.
Setting boxBelow to -cellnum lets you specify an explicit cell number within the boxed row from which the current cell will sit below vertically. The cells specified within the boxed row are counted, starting at 1 until cellnum is reached and then the current cell will sit below it.
Note that setting boxBelow to a non-empty string overrides 3B2's automatic behaviour and can give odd results including forcing cells to clash into one another; particularly when using a negative cellnum.
boxBelow
Access
read-write
Returns
String
boxGutter attribute
PI: tbcboxgut
Specifies the gutter used when stacking cells in a boxed row. By default this has value 0 which means that cells touch. When you specify a value for an individual cell, it adds the space when working out how to stack the current cell in relation to existing cells in the boxed row. It does not effect subsequent cells which have their own gutter.
This applies when stacking either above or below.
It has no effect for any cells that sit on the baseline when stacking above; but does effect the first cells to stack below.
boxGutter
Access
read-write
Returns
fLength
boxLeft attribute
PI: tbcboxl
Allows you to adjust the left hand edge of individual cells depending on the hash rule width of the cells that they stack above/below. This is the corresponding property to boxRight which allows you to control the right hand edge. Note, this has no effect to cells that sit on the baseline of the box row and has no effect if the cell your stacking above/below doesn't have ruleHashWidths set.
boxLeft takes 4 possible values as follows:
0
This is the default. The left hand edge of the cell is the left hand edge of the left-most column that it spans.
1
As 0, but instead of using the column edge it uses the edge of the leftmost cell that it directly stacks on.
2
The left hand edge of the cell is the left edge of the hash rule width of the left most cell.
3
As 2, but the cell is a bit wider to allow for any cell rules and padding, so that the resulting left hand edge of the text measure is the left edge of the hash rule width of the left most cell.
boxLeft
Access
read-write
Returns
int
boxRight attribute
PI: tbcboxr
boxRight allows you to adjust the right hand edge of individual cells depending on the width of the cells that they stack above/below. See boxLeft for details, which is the corresponding command for the left hand edge.
boxRight
Access
read-write
Returns
int
boxVertical attribute
PI: tbcboxv
Because of the way that cells stack within a boxed row, some of the cells can have gaps above or below them. boxVertical controls the basic vertical justification within the boxed row and how these cells can handle these gaps. It is a post-process that takes place after doing the initial stacking. For cells within the boxed row that stack above, boxVertical will let them interact with the potential gap between them and the cell that stacks immediately above them. For cells that stack below, it works with the corresponding gap below the cell.
If there are some cells within the boxhead that don't stack in the conventional way by basing the stacking on alternative designated columns or cells, then this is outside of the scope of boxVertical and you'll get odd results.
boxVertical takes 4 possible values as follows:
0
This is the default. The cells just stack above or below the box row baseline without any adjustments for the gaps above and below the cells.
1
The cells move fully into the gap above or below them, leaving the gap on the other side of them.
2
The cells move half way into the gap above or below them, thus centering themselves within their space.
4
The cells stretch to fill in the gap above or below them.
boxVertical
Access
read-write
Returns
int
boxVerticalExtra attribute
PI: tbcboxve
Affects the bahaviour of both boxVertical and boxVerticalPre. They both normally only affect cells that have cells above them within the boxed row. Setting boxVerticalExtra = true then cells that space above them within the height of the row, but not cells, will also have that extra space available for boxVertical and boxVerticalPre.
boxVerticalExtra
Access
read-write
Returns
boolean
boxVerticalPre attribute
PI: tbcboxvp
When boxVerticalPre is true, it specifies a pre-move option for boxVertical; it does nothing unless boxVertical has a non-zero value of either 1 or 2 and is probably only useful for a value of 1. The pre-move option means that any cells that move either fully or half way into their corresponding gaps within a boxhead; make the space they leave behind available for other cells to move into.
N.B. Having made the space available with the pre-move, subsequent cells could stretch into this space instead by using boxVertical = 3.
boxVerticalPre
Access
read-write
Returns
boolean
emptyReference attribute
PI: tbceref
Specfies the reference tag you would like to be called at the occurance of an empty cell in a table if any.
emptyReference
Access
read-write
Returns
fStream
heightIncludePadding attribute
PI: tbchincpad
When applying the specified height, should top and bottom padding be included. See fTableCell::minimumHeight
heightIncludePadding
Access
read-write
Returns
boolean
horizontalAlign attribute
PI: tbcfmth
Specifies the horizontal format of this individual table cell.
horizontalAlign
Access
read-write
Returns
String
ignoreRuleWidths attribute
PI: tbcignrw
If false then cell rules extend into the cell and their width reduces the amount of space for content. If true then the width of any cell rules are ignored and they are drawn centred on the cell boundary.
ignoreRuleWidths
Access
read-write
Returns
boolean
indent attribute
PI: tbcindent
The cell indent is measured from the inside of the cell's rules after taking into account any cell padding and the indentstart property. This applies to the first line of text only. See also indentAbsolute.
indent
Access
read-write
Returns
fLength
indentAbsolute attribute
PI: tbcindentabs
This property can be used to control where the start edge of the cell indent is measured from.
If 0 (the default) the indent is relative to the cells padding and indentstart.
If 1 the indent is relative to the cell margin. This will be the start edge of the cell indent.
indentAbsolute
Access
read-write
Returns
int
indentEnd attribute
PI: tbcindentend
The cell indent is measured from the inside of the cell's rules after taking into account any cell padding. See also absoluteEnd.
The cell edge (left or right) this property is applied to follows fTable.progression. If fTable.progression is 0, this indent is applied to the right of the cell. If fTable.progression is 1, this indent is applied to the left of the cell.
indentEnd
Access
read-write
Returns
fLength
indentStart attribute
PI: tbcindentstart
The cell start indent is measured from the inside of the cell's rules after taking into account any cell padding. See also absoluteStart.
The cell edge (left or right) this property is applied to follows fTable.progression. If fTable.progression is 0, this indent is applied to the left of the cell. If fTable.progression is 1, this indent is applied to the right of the cell.
indentStart
Access
read-write
Returns
fLength
indentTab attribute
PI: tbcindenttab
The cell indentation tab stop. This tab stop is used after the fTableCell.indent is applied.
indentTab
Access
read-write
Returns
fBlockTab
indentTab2 attribute
PI: tbcindenttab2
The second cell indentation tab stop. This tab stop is used after the fTableCell.indent is applied.
indentTab2
Access
read-write
Returns
fBlockTab
keepTogether attribute
PI: tbckeeptog
Specifies that the contents of the table cell is kept together, using the priorities in the same way other table keeps work. This is only used if fTable.overflowis set to 2 or 3.
This is a column based keep and ensures that the cell is kept within the same parent column, be it either a frame column, a slim table column or a block column.
keepTogether
Access
read-write
Returns
int
minimumHeight attribute
PI: tbcminh
Specify the minimum height for this cell.
From APP 10.0 M040, fTableCell::ignoreRuleWidths and fTableCell::heightIncludePadding will be used when determining the cell height.
If fTableCell::ignoreRuleWidths is true, the minimum height will include the width of any specified rules.
If fTableCell::heightIncludePadding is true, the minimum height will include the top and bottom padding.
minimumHeight
Access
read-write
Returns
fLength
paddingBottom attribute
PI: tbcpadb
Specifies padding at the bottom of this cell
paddingBottom
Access
read-write
Returns
fLength
paddingLeft attribute
PI: tbcpadl
Specifies padding to the left of this cell.
paddingLeft
Access
read-write
Returns
fLength
paddingRight attribute
PI: tbcpadr
Specifies padding to the right of this cell
paddingRight
Access
read-write
Returns
fLength
paddingTop attribute
PI: tbcpadt
Specifies padding at the top of this cell
paddingTop
Access
read-write
Returns
fLength
paraAttributes attribute
PI: tbcpat
This allows you to pass attributes to the reference defined by paraReference. These attributes can then modify the behaviour of your reference, by inheriting alternative properties for the table etc. This is particularly useful if your mark-up defines text properties for the table.
paraAttributes
Access
read-write
Returns
String
paraAttributesCombine attribute
PI: tbcpatc
By default, within a cell, the value of paraAttributes that is in use will be taken from either the default for the table/column as defined in fTable::defaultCell and fTable::columns or from the default for the row set with fFormatting::tableRowStart, with the usual precedence. When num is set to 1, then the paragraph attributes specified for the two defaults will be combined instead.
paraAttributesCombine
Access
read-write
Returns
boolean
paraReference attribute
PI: tbcpref
Assigns a style reference tag to this individual table cell.
paraReference
Access
read-write
Returns
fStream
recallRelativeIndent attribute
PI: tbcrir
If set to true then it recalls the value of the relative indent from the previous row. i.e. If there is a fStyle::relativeIndent in force at the end of the cell in the previous row, then the value of the indent will be reinstated for this cell. Note that this recalls the exact value of the indent which is relative to the left hand edge of the paragraph - if the current paragraph has a different left hand edge than the previous one due to margins, cell rules etc., then the indents won't line up exactly. Using fTableColumn.columns[idx].recallRelativeIndent instead of fTableCell::recallRelativeIndent sets the default value for the column idx, which can then be over-ridden on a cell by cell basis.
recallRelativeIndent
Access
read-write
Returns
boolean
ruleHashWidth attribute
PI: tbcrhash
This allows you to specify a secondary width that the cell rules can use if they include a # flag. The second parameter is optional, and if present, the second form of the command is used. The value assigned to this property have the meanings specified in RuleHashWidths.
If a second parameter is given separated by a comma, then the hash rule width uses details from the sub-column and tab1 and tab2 specify the range of tabs whose widths you want to include. The tabs are numbered starting at 1, and so 0 always means the left hand edge.
ruleHashWidth
Access
read-write
Returns
String
ruleLeftFrameGutter attribute
PI: tbcrlfcgut
Cell rules span left into frame gutter. This works in a similar way to ruleLeftGutter but used when the gutter in question is one of the frame-column gutters rather than the normal table-column gutters.
ruleLeftFrameGutter
Access
read-write
Returns
String
ruleLeftGutter attribute
PI: tbcrlgut
When you have applied cell rules to your table it is possible to make the rule span into the gutter to the left of the cell.
ruleLeftGutter
Access
read-write
Returns
String
ruleRightFrameGutter attribute
PI: tbcrrfcgut
Cell rules span right into frame gutter. This works in a similar way to ruleLeftGutter but used when the gutter in question is one of the frame-column gutters rather than the normal table-column gutters.
ruleRightFrameGutter
Access
read-write
Returns
String
ruleRightGutter attribute
PI: tbcrrgut
When you have applied cell rules to your table it is possible to make the rule span into the gutter to the right of the cell.
ruleRightGutter
Access
read-write
Returns
String
rules attribute
PI: tbcrules
The set of rules around this table cell.
rules
Access
read-write
Returns
fRules
spanColumnsNum attribute
PI: tbcspan
Enter the number of rows you wish to span.
Spanning columns is achieved using this property. This property works in much the same way as spanRows. The command specifies the number of columns that the text should span, you apply the command to the cell that you want to span others. For example if you want a cell to span two cells set cell.spanColumns = 2.
spanColumnsNum
Access
read-write
Returns
int
spanRows attribute
PI: tbrspan
Specifies the number of rows a table cell should span over.
This property enables cells to span rows in a table. You need to enter a value for the number of rows you want the cell to span.
The property must be set before the cell content that you want it applied to. For example if you entered cell.spanRows = 2 before a cell it would extend into the next row down in the table. When you instruct a cell to span rows it has a knock-on effect on all the other cells in the table.
spanRows
Access
read-write
Returns
int
verticalAlign attribute
PI: tbcfmtv
Specifies the vertical alignment of text within this individual table cell.
verticalAlign
Access
read-write
Returns
String
widthIgnore attribute
PI: tbcignw
With Version 2 tables, 3B2 will normally pre-scan the data for the table, to determine how many columns there are and to pick up width information about the columns. By default it will measure how wide the data for each column is and then will set the width of the column, to the widest text in that column.
Setting widthIgnore = true within a cell, tells 3B2 to ignore the width of this particular cell when doing the pre-scan, allowing you to include a paragraph of text which you want to wrap. Another common use may be to specify table.defaultCell.widthIgnore = trueas the default attribute for the whole table, and then use widthIgnore = false for the headers, so that they alone control the widths of the columns.
widthIgnore
Access
read-write
Returns
boolean
widthMode attribute
PI: tbchmode
When columns are being measured, the value of code effects how the width of this cell is taken into account. For every column 3B2 calculates a minimum and a maximum width, which is the maximum of all the cells minimum and maximum widths from that column.
widthMode
Access
read-write
Returns
String
widthOverlapMode attribute
PI: tbcwoverlap
If false then when content is too wide for a cell it will skip into the following cell and add a warning to the format log. If true then content for a cell that is too wide, is allowed to overlap the cell width instead - but the warning is still issued.
widthOverlapMode
Access
read-write
Returns
boolean
fTableCell method
Create a new fTableCell object.
fTableCell
Parameters
None
Returns
fTableCell. The newly created object.
readResolve method
Return the object corresponding to the given serialized representation.
readResolveobj
Parameters
Objectobj
The serialized representation.
Returns
fTableCell. The object corresponding to the serialized representation.
writeReplace method
Create a serializable representation of this object.
writeReplace
Parameters
None
Returns
Object. A serializable representation of this object.