{"modulePath":"github.com/cppforlife/go-cli-ui","version":"v0.0.0-20250603184554-47874c9078ad","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package table\n\n## Constants\n\n```go\nconst UNKNOWN_HEADER_MAPPING rune = '_'\n```\n\n## Functions\n\n```go\nfunc KeyifyHeader(header string) string\n```\n\n## Types\n\n```go\ntype ColumnSort struct {\n\tColumn int\n\tAsc    bool\n}\n```\n\n```go\ntype EmptyValue struct{}\n```\n\n```go\nfunc (t EmptyValue) Compare(Value) int\n```\n\n```go\nfunc (t EmptyValue) String() string\n```\n\n```go\nfunc (t EmptyValue) Value() Value\n```\n\n```go\ntype Header struct {\n\tKey    string\n\tTitle  string\n\tHidden bool\n}\n```\n\n```go\nfunc NewHeader(title string) Header\n```\n\n```go\ntype Section struct {\n\tFirstColumn Value\n\tRows        [][]Value\n}\n```\n\n```go\ntype Sorting struct {\n\tSortBy []ColumnSort\n\tRows   [][]Value\n}\n```\n\n```go\nfunc (s Sorting) Len() int\n```\n\n```go\nfunc (s Sorting) Less(i, j int) bool\n```\n\n```go\nfunc (s Sorting) Swap(i, j int)\n```\n\n```go\ntype Table struct {\n\tTitle   string\n\tContent string\n\n\tHeader []Header\n\n\tSortBy []ColumnSort\n\n\t// Either sections or rows should be provided\n\tSections []Section\n\tRows     [][]Value\n\n\tNotes []string\n\n\t// Formatting\n\tHeaderFormatFunc func(string, ...interface{}) string\n\tDataOnly         bool\n\tFillFirstColumn  bool\n\tDuplicateStr     string\n\tBackgroundStr    string\n\tBorderStr        string\n\tTranspose        bool\n}\n```\n\n```go\nfunc (t Table) AddColumn(header string, values []Value) Table\n```\n\n```go\nfunc (t Table) AsRows() [][]Value\n```\n\n```go\nfunc (t Table) Print(w io.Writer) error\n```\n\n```go\nfunc (t *Table) SetColumnVisibility(headers []Header) error\n```\n\n```go\ntype Value interface {\n\tValue() Value\n\tString() string\n\tCompare(Value) int\n}\n```\n\n```go\ntype ValueBool struct {\n\tB bool\n}\n```\n\n```go\nfunc NewValueBool(b bool) ValueBool\n```\n\n```go\nfunc (t ValueBool) Compare(other Value) int\n```\n\n```go\nfunc (t ValueBool) String() string\n```\n\n```go\nfunc (t ValueBool) Value() Value\n```\n\n```go\ntype ValueError struct {\n\tE error\n}\n```\n\n```go\nfunc NewValueError(e error) ValueError\n```\n\n```go\nfunc (t ValueError) Compare(other Value) int\n```\n\n```go\nfunc (t ValueError) String() string\n```\n\n```go\nfunc (t ValueError) Value() Value\n```\n\n```go\ntype ValueFmt struct {\n\tV     Value\n\tError bool\n\tFunc  func(string, ...interface{}) string\n}\n```\n\n```go\nfunc NewValueFmt(v Value, error bool) ValueFmt\n```\n\n```go\nfunc (t ValueFmt) Compare(other Value) int\n```\n\n```go\nfunc (t ValueFmt) Fprintf(w io.Writer, pattern string, rest ...interface{}) (int, error)\n```\n\n```go\nfunc (t ValueFmt) String() string\n```\n\n```go\nfunc (t ValueFmt) Value() Value\n```\n\n```go\ntype ValueInt struct {\n\tI int\n}\n```\n\n```go\nfunc NewValueInt(i int) ValueInt\n```\n\n```go\nfunc (t ValueInt) Compare(other Value) int\n```\n\n```go\nfunc (t ValueInt) String() string\n```\n\n```go\nfunc (t ValueInt) Value() Value\n```\n\n```go\ntype ValueInterface struct {\n\tI interface{}\n}\n```\n\n```go\nfunc NewValueInterface(i interface{}) ValueInterface\n```\n\n```go\nfunc (t ValueInterface) Compare(other Value) int\n```\n\n```go\nfunc (t ValueInterface) String() string\n```\n\n```go\nfunc (t ValueInterface) Value() Value\n```\n\n```go\ntype ValueNone struct{}\n```\n\n```go\nfunc (t ValueNone) Compare(other Value) int\n```\n\n```go\nfunc (t ValueNone) String() string\n```\n\n```go\nfunc (t ValueNone) Value() Value\n```\n\n```go\ntype ValueString struct {\n\tS string\n}\n```\n\n```go\nfunc NewValueString(s string) ValueString\n```\n\n```go\nfunc (t ValueString) Compare(other Value) int\n```\n\n```go\nfunc (t ValueString) String() string\n```\n\n```go\nfunc (t ValueString) Value() Value\n```\n\n```go\ntype ValueStrings struct {\n\tS []string\n}\n```\n\n```go\nfunc NewValueStrings(s []string) ValueStrings\n```\n\n```go\nfunc (t ValueStrings) Compare(other Value) int\n```\n\n```go\nfunc (t ValueStrings) String() string\n```\n\n```go\nfunc (t ValueStrings) Value() Value\n```\n\n```go\ntype ValueSuffix struct {\n\tV      Value\n\tSuffix string\n}\n```\n\n```go\nfunc NewValueSuffix(v Value, s string) ValueSuffix\n```\n\n```go\nfunc (t ValueSuffix) Compare(other Value) int\n```\n\n```go\nfunc (t ValueSuffix) String() string\n```\n\n```go\nfunc (t ValueSuffix) Value() Value\n```\n\n```go\ntype ValueTime struct {\n\tT time.Time\n}\n```\n\n```go\nfunc NewValueTime(t time.Time) ValueTime\n```\n\n```go\nfunc (t ValueTime) Compare(other Value) int\n```\n\n```go\nfunc (t ValueTime) String() string\n```\n\n```go\nfunc (t ValueTime) Value() Value\n```\n\n```go\ntype Writer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewWriter(w io.Writer, emptyStr, bgStr, borderStr string) *Writer\n```\n\n```go\nfunc (w *Writer) Flush() error\n```\n\n```go\nfunc (w *Writer) Write(headers []Header, vals []Value)\n```\n\n","path":"github.com/cppforlife/go-cli-ui/ui/table","name":"table","synopsis":"","isRedistributable":true}
