From a24a53e9126729b21182600edc6e174d36c1b83d Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sat, 19 Apr 2025 18:21:49 +0200 Subject: [PATCH] Table error fix --- .gitignore | 1 + src/elements/Table.lua | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1696836..e6aad7c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tests testWorkflows .vscode todo.txt +Flexbox2.lua diff --git a/src/elements/Table.lua b/src/elements/Table.lua index 65ceadd..66b0985 100644 --- a/src/elements/Table.lua +++ b/src/elements/Table.lua @@ -183,7 +183,10 @@ function Table:render() for i, col in ipairs(columns) do local cellText = tostring(rowData[i] or "") local paddedText = cellText .. string.rep(" ", col.width - #cellText) - self:blit(currentX, y, string.sub(paddedText, 1, width-currentX+1), + if i < #columns then + paddedText = string.sub(paddedText, 1, col.width - 1) .. " " + end + self:blit(currentX, y, string.sub(paddedText, 1, col.width), string.sub(string.rep(tHex[self.get("foreground")], col.width), 1, width-currentX+1), string.sub(string.rep(tHex[bg], col.width), 1, width-currentX+1)) currentX = currentX + col.width