WithPadding overrides the padding function for the field. The function should transform a string argument into a string that is padded to fit within the given display width. The default behavior is to pad fields with spaces except for the last field. The padding function will be called after truncat
(fn func(int, string) string)
| 35 | // with spaces except for the last field. The padding function will be called after truncation and before coloring. |
| 36 | // Pass nil to disable padding for this value. |
| 37 | func WithPadding(fn func(int, string) string) fieldOption { |
| 38 | return func(f *tableField) { |
| 39 | f.paddingFunc = fn |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | // WithColor sets the color function for the field. The function should transform a string value by wrapping |
| 44 | // it in ANSI escape codes. The color function will not be used if the table was initialized in non-terminal mode. |
no outgoing calls
searching dependent graphs…