ReadonlycellsEvery cell, in document order.
ReadonlyheightRows in the grid, the table's rows.
ReadonlywidthColumns in the grid.
The cell covering a grid position, or null for a hole or a position off the grid.
The cell at a row and index in the document, or null.
Every cell overlapping a rectangle, once each, in document order.
The smallest rectangle holding both cells.
Staticof
A table laid out on its grid, as HTML lays out
colspanandrowspan: each row's cells take the first columns that no cell spanning down from a row above already covers.A row's cells alone cannot say which columns they stand in once a cell above spans down into the row, so everything that reasons about columns (commands, exports, serializers) reads them from here. Tables are immutable, so a map is built once per table node and kept.
Nothing is assumed about the table being well formed. A span that runs past the last row stops there, a short row leaves holes (positions no cell covers), and where two cells overlap the first one placed keeps the spot.