Skip to content

TableCell ​

Defined in: components/table.ts:17

Implements ​

Constructor components/table.ts:22 ​

new TableCell(content, options?): TableCell

Parameters ​

ParameterType
contentComponent
object
backgroundColor?string | Color
valign?"top" | "middle" | "bottom"

Returns ​

TableCell

Properties ​

PropertyModifierType
backgroundColor?
table.ts:19
publicstring | Color
content
table.ts:18
publicComponent
valign?
table.ts:20
public"top" | "middle" | "bottom"

Methods ​

draw() components/table.ts:35 ​

draw(writer, x, y, width, availableHeight, context): Component | null

Draws the component (or a part of it) on the page.

Parameters ​

ParameterTypeDescription
writerPDFPageWriterThe page writer to issue commands to.
xnumberThe current relative X coordinate from the left margin.
ynumberThe current relative Y coordinate from the bottom margin (top boundary of the element).
widthnumberThe width constraint allocated to this element.
availableHeightnumberThe height constraint representing remaining space on the current page.
contextLayoutContextThe layout configuration context.

Returns ​

Component | null

A new Component representing the remainder of this component if it could not finish rendering, or null if it rendered completely.

Implementation of ​

Component.draw

measure() components/table.ts:31 ​

measure(width, context): object

Returns the width and height required by this component when rendered within a given width constraint.

Parameters ​

ParameterType
widthnumber
contextLayoutContext

Returns ​

object

NameType
height
table.ts:31
number
width
table.ts:31
number

Implementation of ​

Component.measure

Released under the MIT License.