Table error fix

This commit is contained in:
Robert Jelic
2025-04-19 18:21:49 +02:00
parent 0be15d612a
commit a24a53e912
2 changed files with 5 additions and 1 deletions

View File

@@ -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