Upstream rodaine/table state of the touched files before 9c71bfd95e
This commit is contained in:
1 parent
b384e08abf
commit
c86829d169
2 files changed
+2
-32
No files matched your search
@@ -238,13 +238,10 @@ func (t *table) SetRows(rows [][]string) Table {
|
||||
headerLength := len(t.header)
|
||||
|
||||
for _, row := range rows {
|
||||
if len(row) >= headerLength {
|
||||
if len(row) > headerLength {
|
||||
t.rows = append(t.rows, row[:headerLength])
|
||||
} else {
|
||||
// pad short rows so every column is rendered, matching AddRow
|
||||
padded := make([]string, headerLength)
|
||||
copy(padded, row)
|
||||
t.rows = append(t.rows, padded)
|
||||
t.rows = append(t.rows, row)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user