Table
Defined in: components/table.ts:67
Implements
Constructor components/table.ts:83
new Table(
options):Table
Parameters
| Parameter | Type |
|---|---|
options | object |
aligns? | ("left" | "center" | "right")[] |
alternateRowBackgroundColor? | string | Color |
backgroundColor? | string | Color |
borderColor? | string | Color |
borderWidth? | number |
columns | (string | number)[] |
headerBackgroundColor? | string | Color |
padding? | number | { |
repeatHeader? | boolean |
valign? | "top" | "middle" | "bottom" |
valigns? | ("top" | "middle" | "bottom")[] |
Returns
Table
Properties
| Property | Modifier | Type | Default value |
|---|---|---|---|
aligns?table.ts:78 | public | ("left" | "center" | "right")[] | undefined |
alternateRowBackgroundColor?table.ts:75 | public | string | Color | undefined |
backgroundColor?table.ts:73 | public | string | Color | undefined |
borderColortable.ts:72 | public | string | Color | undefined |
borderWidthtable.ts:71 | public | number | undefined |
columnstable.ts:68 | public | (string | number)[] | undefined |
headerBackgroundColor?table.ts:74 | public | string | Color | undefined |
headerstable.ts:70 | public | TableCell[] | [] |
padding?table.ts:76 | public | number | { | undefined |
repeatHeadertable.ts:77 | public | boolean | undefined |
rowstable.ts:69 | public | TableCell[][] | [] |
templateRowstable.ts:81 | public | object[] | [] |
valign?table.ts:79 | public | "top" | "middle" | "bottom" | undefined |
valigns?table.ts:80 | public | ("top" | "middle" | "bottom")[] | undefined |
Methods
addHeader() components/table.ts:132
addHeader(
row):this
Parameters
| Parameter | Type |
|---|---|
row | CellContent[] |
Returns
this
addRow() components/table.ts:137
addRow(
row):this
Parameters
| Parameter | Type |
|---|---|
row | CellContent[] |
Returns
this
addTemplateRow() components/table.ts:142
addTemplateRow(
arrayPath,cells):this
Parameters
| Parameter | Type |
|---|---|
arrayPath | string |
cells | CellContent[] |
Returns
this
draw() components/table.ts:192
draw(
writer,x,y,width,availableHeight,context):Component|null
Draws the component (or a part of it) on the page.
Parameters
| Parameter | Type | Description |
|---|---|---|
writer | PDFPageWriter | The page writer to issue commands to. |
x | number | The current relative X coordinate from the left margin. |
y | number | The current relative Y coordinate from the bottom margin (top boundary of the element). |
width | number | The width constraint allocated to this element. |
availableHeight | number | The height constraint representing remaining space on the current page. |
context | LayoutContext | The 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
getHeaderHeight() components/table.ts:163
getHeaderHeight(
width,context):number
Parameters
| Parameter | Type |
|---|---|
width | number |
context | LayoutContext |
Returns
number
measure() components/table.ts:171
measure(
width,context):object
Returns the width and height required by this component when rendered within a given width constraint.
Parameters
| Parameter | Type |
|---|---|
width | number |
context | LayoutContext |
Returns
object
| Name | Type |
|---|---|
heighttable.ts:171 | number |
widthtable.ts:171 | number |