Class Asciidoctor::Table
In: lib/asciidoctor/table.rb
Parent: AbstractBlock

Public: Methods and constants for managing AsciiDoc table content in a document. It supports all three of AsciiDoc‘s table formats: psv, dsv and csv.

Methods

Classes and Modules

Class Asciidoctor::Table::Cell
Class Asciidoctor::Table::Column
Class Asciidoctor::Table::ParserContext
Class Asciidoctor::Table::Rows

Constants

DEFAULT_DATA_FORMAT = 'psv'   Public: A String key that specifies the default table format in AsciiDoc (psv)
DATA_FORMATS = ['psv', 'dsv', 'csv']   Public: An Array of String keys that represent the table formats in AsciiDoc
DEFAULT_DELIMITERS = { 'psv' => '|', 'dsv' => ':', 'csv' => ','   Public: A Hash mapping the AsciiDoc table formats to their default delimiters
TEXT_STYLES = { 'd' => :none, 's' => :strong, 'e' => :emphasis, 'm' => :monospaced, 'h' => :header, 'l' => :literal, 'v' => :verse, 'a' => :asciidoc   Public: A Hash mapping styles abbreviations to styles that can be applied to a table column or cell
ALIGNMENTS = { :h => { '<' => 'left', '>' => 'right', '^' => 'center'   Public: A Hash mapping alignment abbreviations to alignments (horizontal and vertial) that can be applies to a table column or cell

Attributes

columns  [RW]  Public: Get/Set the columns for this table
has_header_option  [RW]  Public: Boolean specifies whether this table has a header row
rows  [RW]  Public: Get/Set the Rows struct for this table (encapsulates head, foot and body rows)

Public Class methods

Public Instance methods

Internal: Assign column widths to columns

This method rounds the percentage width values to 4 decimal places and donates the balance to the final column.

This method assumes there‘s at least one column in the columns array.

width_base - the total of the relative column values used for calculating percentage widths (default: nil)

returns nothing

Internal: Creates the Column objects from the column spec

returns nothing

Internal: Returns whether the current row being processed is the header row

Internal: Partition the rows into header, footer and body as determined by the options on the table

returns nothing

[Validate]