Corrupted table due to spanning and drawHorizontalLine
- Dominant language
- TypeScript
- Stars
- 973
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following code:
```ts
import { table } from "table";
console.log(
table([
["abc", "abc", " "],
[" ", "abc", " "],
[" ", "abc", " "],
[" ", "abc", "abc"],
],
{
spanningCells: [
{ row: 0, col: 0, rowSpan: 4 },
{ row: 0, col: 1, colSpan: 2 },
{ row: 1, col: 1, colSpan: 2 },
{ row: 2, col: 1, colSpan: 2 },
],
columns: {
0: { width: 3 },
1: { width: 3 },
2: { width: 3 },
},
drawHorizontalLine: (row) => [0, 3, 4].includes(row)
})
);
```
Actual output:
```
╔═════╤═══════════╗
║ abc │ abc ║
║ │ abc ║
║ │ abc ║
║├─────┬─────╢
║ │ abc │ abc ║
╚═════╧═════╧═════╝
```
Expectation:
```
╔═════╤═══════════╗
║ abc │ abc ║
║ │ abc ║
║ │ abc ║
║ ├─────┬─────╢
║ │ abc │ abc ║
╚═════╧═════╧═════╝
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.