Class RTF::TableNode
In: lib/rtf/node.rb
Parent: ContainerNode

This class represents a table node within an RTF document. Table nodes are specialised container nodes that contain only TableRowNodes and have their size specified when they are created an cannot be resized after that.

Methods

Attributes

cell_margin  [R]  Attribute accessor.
cell_margin  [W]  Attribute mutator.

Public Class methods

This is a constructor for the TableNode class.

Parameters

parent:A reference to the node that owns the table.
rows:The number of rows in the tabkle.
columns:The number of columns in the table.
*widths:One or more integers specifying the widths of the table columns.

Public Instance methods

This method assigns a border width setting to all of the sides on all of the cells within a table.

Parameters

width:The border width setting to apply. Negative values are ignored and zero switches the border off.
column_shading_color(index, colour)

This method assigns a shading colour to a specified column within a TableNode object.

Parameters

index:The offset from the first column of the column to have shading applied to it.
colour:A reference to a Colour object representing the shading colour to be used. Set to nil to clear shading.

Attribute accessor.

row_shading_color(index, colour)

Alias for row_shading_colour

This method assigns a shading colour to a specified row within a TableNode object.

Parameters

index:The offset from the first row of the row to have shading applied to it.
colour:A reference to a Colour object representing the shading colour to be used. Set to nil to clear shading.

Attribute accessor.

shading_color(colour)

Alias for shading_colour

This method provides a means of assigning a shading colour to a selection of cells within a table. The method accepts a block that takes three parameters - a TableCellNode representing a cell within the table, an integer representing the x offset of the cell and an integer representing the y offset of the cell. If the block returns true then shading will be applied to the cell.

Parameters

colour:A reference to a Colour object representing the shading colour to be applied. Set to nil to remove shading.

This method overloads the store method inherited from the ContainerNode class to forbid addition of further nodes.

Parameters

node:A reference to the node to be added.

This method generates the RTF document text for a TableCellNode object.

[Validate]