SetColExpand sets the column expand factor. When the table width is increased the columns widths are increased proportionally to their expand factor. A column with expand factor = 0 is not increased.
(colid string, expand float32)
| 482 | // increased proportionally to their expand factor. |
| 483 | // A column with expand factor = 0 is not increased. |
| 484 | func (t *Table) SetColExpand(colid string, expand float32) { |
| 485 | |
| 486 | // Checks column id |
| 487 | c := t.header.cmap[colid] |
| 488 | if c == nil { |
| 489 | panic(tableErrInvCol) |
| 490 | } |
| 491 | if expand < 0 { |
| 492 | c.expand = 0 |
| 493 | } else { |
| 494 | c.expand = expand |
| 495 | } |
| 496 | t.recalc() |
| 497 | } |
| 498 | |
| 499 | // AddRow adds a new row at the end of the table with the specified values |
| 500 | func (t *Table) AddRow(values map[string]interface{}) { |