diff --git a/widgets/table.go b/widgets/table.go index 19fafa3..0dba310 100644 --- a/widgets/table.go +++ b/widgets/table.go @@ -146,6 +146,7 @@ func (self *Table) Draw(buf *Buffer) { } func (self *Table) textWrapTransformer(row []string, i, j, columnWidth int) []string { + // Split words by column width words := strings.Split(row[j], " ") newWords := []string{} nextWords := []string{} @@ -161,6 +162,8 @@ func (self *Table) textWrapTransformer(row []string, i, j, columnWidth int) []st totalChar += len(word) + 1 } row[j] = strings.Join(newWords, " ") + + // Insert new sentence last := len(self.Rows) - 1 self.Rows = append(self.Rows, self.Rows[last]) copy(self.Rows[i+1:], self.Rows[i:last])