class Crst::Table

Overview

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"]]

Defined in:

crst/nodes.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(header : Array(Array(Array(Crst::Node))) = [] of Array(Array(Node)), rows : Array(Array(Array(Crst::Node))) = [] of Array(Array(Node))) #

[View source]

Instance Method Detail

def header : Array(Array(Array(Node))) #

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


[View source]
def header=(header : Array(Array(Array(Node)))) #

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


[View source]
def rows : Array(Array(Array(Node))) #

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


[View source]
def rows=(rows : Array(Array(Array(Node)))) #

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


[View source]