From 04a46906d2e9c29f7b0a7cdc7eae243c2a6b63b7 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sun, 13 Nov 2022 19:07:20 +0100 Subject: [PATCH] lastColumn of a table must also be adjusted when columns are deleted. Fixes #736 --- table.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/table.go b/table.go index 8ae805f..391c757 100644 --- a/table.go +++ b/table.go @@ -329,6 +329,9 @@ func (t *tableDefaultContent) RemoveColumn(column int) { } t.cells[row] = append(t.cells[row][:column], t.cells[row][column+1:]...) } + if column >= 0 && column <= t.lastColumn { + t.lastColumn-- + } } // InsertRow inserts a new row at the given position.