Class: Coradoc::CoreModel::TableCell

Inherits:
Base
  • Object
show all
Includes:
ChildrenContent
Defined in:
lib/coradoc/core_model/table.rb

Overview

Represents a table cell in a document

Table cells can contain text content and have various formatting attributes like alignment, colspan, rowspan, and styling.

Cell format specification: [colspan][halign][style]

Examples:

Creating a table cell with full formatting

cell = CoreModel::TableCell.new(
  content: "Cell content",
  alignment: "center",
  colspan: 2,
  rowspan: 3,
  style: "emphasis",
  bgcolor: "#ffff00"
)

Instance Attribute Summary collapse

Attributes inherited from Base

#element_attributes, #id, #metadata_entries, #title

Method Summary

Methods included from ChildrenContent

#children=, #flat_text, included, #initialize, #renderable_content, #to_hash

Methods inherited from Base

#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata

Instance Attribute Details

#alignmentString?

Returns horizontal text alignment (‘left’, ‘center’, ‘right’).

Returns:

  • (String, nil)

    horizontal text alignment (‘left’, ‘center’, ‘right’)



30
# File 'lib/coradoc/core_model/table.rb', line 30

attribute :alignment, :string

#bgcolorString?

Note:

Populated by HTML converter only

Returns background color (CSS color value).

Returns:

  • (String, nil)

    background color (CSS color value)



56
# File 'lib/coradoc/core_model/table.rb', line 56

attribute :bgcolor, :string

#colorString?

Note:

Populated by HTML converter only

Returns text color (CSS color value).

Returns:

  • (String, nil)

    text color (CSS color value)



61
# File 'lib/coradoc/core_model/table.rb', line 61

attribute :color, :string

#colspanInteger?

Returns number of columns to span.

Returns:

  • (Integer, nil)

    number of columns to span



38
# File 'lib/coradoc/core_model/table.rb', line 38

attribute :colspan, :integer

#contentString?

Returns text content of the cell.

Returns:

  • (String, nil)

    text content of the cell



26
# File 'lib/coradoc/core_model/table.rb', line 26

attribute :content, :string

#headerBoolean

Returns whether this is a header cell.

Returns:

  • (Boolean)

    whether this is a header cell



46
# File 'lib/coradoc/core_model/table.rb', line 46

attribute :header, :boolean, default: -> { false }

#heightString?

Note:

Populated by HTML converter only

Returns cell height (CSS height value).

Returns:

  • (String, nil)

    cell height (CSS height value)



71
# File 'lib/coradoc/core_model/table.rb', line 71

attribute :height, :string

#rowspanInteger?

Returns number of rows to span.

Returns:

  • (Integer, nil)

    number of rows to span



42
# File 'lib/coradoc/core_model/table.rb', line 42

attribute :rowspan, :integer

#styleString?

Returns cell style (‘default’, ‘strong’, ‘emphasis’, ‘monospace’, ‘asciidoc’, ‘literal’, ‘verse’).

Returns:

  • (String, nil)

    cell style (‘default’, ‘strong’, ‘emphasis’, ‘monospace’, ‘asciidoc’, ‘literal’, ‘verse’)



51
# File 'lib/coradoc/core_model/table.rb', line 51

attribute :style, :string

#vertical_alignmentString?

Returns vertical alignment (‘top’, ‘middle’, ‘bottom’).

Returns:

  • (String, nil)

    vertical alignment (‘top’, ‘middle’, ‘bottom’)



34
# File 'lib/coradoc/core_model/table.rb', line 34

attribute :vertical_alignment, :string

#widthString?

Note:

Populated by HTML converter only

Returns cell width (CSS width value).

Returns:

  • (String, nil)

    cell width (CSS width value)



66
# File 'lib/coradoc/core_model/table.rb', line 66

attribute :width, :string