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§
- Placed
Cell - 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": … }inbook.json(the block’s JSON is flat;Block::Table(Table)). - Table
Cell - One cell of a
Table: inlines only (a cell of two paragraphs is two lines of one cell, joined byInline::LineBreak). - Table
Column - One column of a
Table. - Table
Layout - 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§
- Column
Align - How the text of a column (or one cell) is aligned.
Constants§
- MAX_
AUTO_ COLUMNS - The widest table
Table::layoutmakes whencolumnsis empty and the width has to be taken from the rows.