Skip to main content

Module table

Module table 

Source
Expand description

The table block: rows and columns, header rows, per-column alignment, merged cells and a caption. A cell holds inlines.

A stored table can be damaged (a hand-edited file, a bug), so nothing that draws a table reads rows by position: Table::layout turns any stored table into the one grid every renderer agrees on, and Table::normalized writes that grid back as a stored table. Reading a file never normalizes it.

Structs§

PlacedCell
A cell of Table::layout: where it stands in the grid, what it covers. It borrows its text from the table, so a footnote in it can be kept for as long as the table lives (the EPUB writer collects notes by reference).
Table
A table: { "type": "table", "columns": …, "rows": … } in book.json (the block’s JSON is flat; Block::Table(Table)).
TableCell
One cell of a Table: inlines only (a cell of two paragraphs is two lines of one cell, joined by Inline::LineBreak).
TableColumn
One column of a Table.
TableLayout
The table the model means: a complete grid. Every position is covered exactly once, every row has a cell of its own, no span crosses the table’s edge or the header boundary. Cells are in reading order (by row, then column).

Enums§

ColumnAlign
How the text of a column (or one cell) is aligned.

Constants§

MAX_AUTO_COLUMNS
The widest table Table::layout makes when columns is empty and the width has to be taken from the rows.