class

Crst::Table

Inherits Crst::Node < Reference < Object

Represents a table with header and data rows

Tables can be created from simple tables, grid tables, or list-table directives in RST. Each cell contains plain text.

Example:

# RST list-table:
# .. list-table::
#    :header-rows: 1
#
#    * - Name
#      - Age
#    * - Alice
#      - 30

table = Crst::Table.new
table.header = [["Name", "Age"]]
table.rows = [["Alice", "30"], ["Bob", "25"]]

Constructors

new(header : Array(Array(Array(Crst::Node))) = [] of Array(Array(Node)), rows : Array(Array(Array(Crst::Node))) = [] of Array(Array(Node)))
Source

Instance methods

header

Header rows of the table (optional), each cell is pre-parsed inline nodes

Source
header=(header : Array(Array(Array(Node))))

Header rows of the table (optional), each cell is pre-parsed inline nodes

Source
rows

Data rows of the table, each cell is pre-parsed inline nodes

Source
rows=(rows : Array(Array(Array(Node))))

Data rows of the table, each cell is pre-parsed inline nodes

Source