cell

fun cell(verticalAlignment: VerticalAlignment = VerticalAlignment.Top, horizontalAlignment: HorizontalAlignment = HorizontalAlignment.Start, background: PdfColor? = null, padding: Padding? = null, colSpan: Int = 1, rowSpan: Int = 1, block: ContainerScope.() -> Unit)

Adds a configurable cell whose contents are described inside block.

Inside block you have a normal ContainerScope — you can stack multiple texts, embed an image, or even nest a row / column.

Parameters

colSpan

how many columns the cell occupies. Values 1 merge this cell across the next colSpan - 1 columns of the same row; the row's later cells shift right to fill the remaining columns.

rowSpan

how many rows the cell occupies. Values 1 extend the cell downward across the next rowSpan - 1 rows; those rows skip the occupied column(s) when laying out their own cells. Both spans are clamped to the grid at layout time.


fun cell(value: String, verticalAlignment: VerticalAlignment = VerticalAlignment.Top, horizontalAlignment: HorizontalAlignment = HorizontalAlignment.Start, background: PdfColor? = null, padding: Padding? = null, colSpan: Int = 1, rowSpan: Int = 1, textBlock: TextScope.() -> Unit = {})

Adds a simple text cell.

Equivalent to cell { text(value, block) } but keeps the call site readable when the cell contents are a single short label. See the block overload for colSpan / rowSpan semantics.