From 88d9b92e8daea611880aff63cf724f816e78732f Mon Sep 17 00:00:00 2001 From: Antonio Stoilkov Date: Thu, 8 Feb 2024 10:56:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20`consoleTable()`=20cell=20paddin?= =?UTF-8?q?g=20is=20+1=20space=20on=20the=20right?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extras/consoleTable/consoleTableRow.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/extras/consoleTable/consoleTableRow.ts b/src/extras/consoleTable/consoleTableRow.ts index 0f7cc19..ac7d4b0 100644 --- a/src/extras/consoleTable/consoleTableRow.ts +++ b/src/extras/consoleTable/consoleTableRow.ts @@ -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)), ]);