-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
I came across an error in the typing of the margins property in the TableConfig interface definition.
In the table function, the config parameter can include a margins object, which is expected to have four properties: left, top, bottom, and width. You can see this implementation in this reference.
However, if you look at the typings, the Table definition expects a TableConfig object (see Table definition). In this TableConfig, the margins property is incorrectly defined as a number instead of an object with the shape { top: number, bottom: number, left: number, width: number }.
This discrepancy leads to issues when you pass a TableConfig like this:
tableConfig:{ margins: 10 }
In this case, when the table reaches the end of the page, it won’t create a new page as expected.
It’s important to note that if no margins are provided in the tableConfig, the program uses default margins (See here). However, if a number is passed (as allowed by the current typings), the program detects that a value is present and does not apply the default margins, leading to unexpected behavior.