wdpr
    Preparing search index...

    Module parser/rules/block/table-block

    Block rule for the explicit block-syntax table: [[table]][[row]][[cell]]...[[/cell]][[/row]][[/table]].

    This is the structured alternative to the pipe-syntax table (||). Each element carries optional HTML attributes:

    [[table class="wiki-table"]]
    [[row]]
    [[hcell style="width: 50%"]]Header[[/hcell]]
    [[cell colspan="2"]]Data[[/cell]]
    [[/row]]
    [[/table]]

    Key details:

    • [[hcell]] produces header cells (<th>), [[cell]] produces data cells (<td>).
    • colspan is extracted from cell attributes and mapped to column-span.
    • Alignment can be derived from the style attribute's text-align value.
    • Cell content supports both block and inline elements, including nested tables. The custom parseCellContent() handles paragraph wrapping and block detection within cells.
    • Empty tables or tables with only empty rows fail the rule, falling back to text rendering.
    • The table element carries _source: "block" in attributes to distinguish it from pipe-syntax tables.

    Variables

    tableBlockRule