Skip to content

Commit

Permalink
🐛 consoleTable() cell padding is +1 space on the right
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Feb 8, 2024
1 parent 2ff45fd commit 88d9b92
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/extras/consoleTable/consoleTableRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export default function consoleTableRow(
columnsSize: number[],
cellBorder: CellBorder,
): ConsoleText[] {
const cellPadding = 2;
const spans: ConsoleText[] = [];
for (let i = 0; i < cells.length; i++) {
const padEnd = columnsSize[i]! + 2 - spansLength(cells[i]!.spans);
const padEnd =
columnsSize[i]! + cellPadding - spansLength(cells[i]!.spans);
const cellWithPadding = createTableCell([
consoleText(" "),
consoleText(" ".repeat(cellPadding)),
...cells[i]!.spans,
consoleText(" ".repeat(padEnd)),
]);
Expand Down

0 comments on commit 88d9b92

Please sign in to comment.