<aside> 👉
Links (Block base class)
Notion Ruby Mapping Public API Reference
</aside>
self.new(table_width: nil, has_column_header: false, has_row_header: false, table_rows: nil) → TableBlockCreates a TableBlock. A new table contains one or more TableRowBlock children and has a fixed number of columns.
Integer greater than zero ... explicitly sets the number of columnsnil ... infers the number of columns from the first rowBoolean; treats the first row as a column header when trueBoolean; treats the first column as a row header when trueArray<TableRowBlock> ... rows created in advanceArray<Array> ... row values converted to TableRowBlock objectsTableBlockStandardError ... raised when a new table is empty, table_width is not a positive Integer, a row width differs from table_width, or a header option is not Booleantable = TableBlock.new(
has_column_header: true,
table_rows: [
%w[Name Score],
["Alice", "90"],
],
)
<aside> ⚠️
A new table must contain at least one non-empty row. Every row must contain exactly table_width cells. A table retrieved from Notion does not include its rows in the table block response; retrieve them separately through children.
</aside>
Returns the fixed number of columns. The value is inferred from the first row when it is omitted while building a new table. table_width cannot be changed after creation.
Returns whether the first row is treated as a column header.
Changes the column-header setting and marks it for the next block update.
true or false