Documentation
¶
Overview ¶
Package tw provides utility functions for text formatting, width calculation, and string manipulation specifically tailored for table rendering, including handling ANSI escape codes and Unicode text.
Package tw defines types and constants for table formatting and configuration, including validation logic for various table properties.
Index ¶
- Constants
- Variables
- func BreakPoint(s string, limit int) int
- func IsIsNumericOrSpace(r rune) bool
- func IsNumeric(s string) bool
- func Max(a, b int) int
- func Min(a, b int) int
- func Or(cond bool, valid, inValid string) string
- func Pad(s, padChar string, totalWidth int, alignment Align) string
- func PadCenter(s, pad string, width int) string
- func PadLeft(s, pad string, width int) string
- func PadRight(s, pad string, width int) string
- func SplitCamelCase(src string) (entries []string)
- func Title(name string) string
- type Align
- type Alignment
- type Behavior
- type Border
- type BorderStyle
- type Caption
- type CellAlignment
- type CellCallbacks
- type CellConfig
- type CellContext
- type CellFilter
- type CellFormatting
- type CellMerging
- type CellPadding
- type CellWidth
- type Compact
- type Control
- type Counter
- type Filter
- type Formatter
- type Formatting
- type Glyphs
- func (s *Glyphs) BottomLeft() string
- func (s *Glyphs) BottomMid() string
- func (s *Glyphs) BottomRight() string
- func (s *Glyphs) Center() string
- func (s *Glyphs) Column() string
- func (s *Glyphs) HeaderLeft() string
- func (s *Glyphs) HeaderMid() string
- func (s *Glyphs) HeaderRight() string
- func (s *Glyphs) MidLeft() string
- func (s *Glyphs) MidRight() string
- func (s *Glyphs) Name() string
- func (s *Glyphs) Preview() string
- func (s *Glyphs) Row() string
- func (s *Glyphs) TopLeft() string
- func (s *Glyphs) TopMid() string
- func (s *Glyphs) TopRight() string
- type KeyValuePair
- type Level
- type LineCounter
- type Lines
- type Location
- type Mapper
- func NewBoolMapper[K comparable](keys ...K) Mapper[K, bool]
- func NewIdentityMapper[K comparable](keys ...K) Mapper[K, K]
- func NewIntMapper[K comparable](keys ...K) Mapper[K, int]
- func NewMapper[K comparable, V any]() Mapper[K, V]
- func SlicerToMapper[K comparable, V any](s Slicer[KeyValuePair[K, V]]) Mapper[K, V]
- func (m Mapper[K, V]) Clear()
- func (m Mapper[K, V]) Clone() Mapper[K, V]
- func (m Mapper[K, V]) Delete(key K) Mapper[K, V]
- func (m Mapper[K, V]) Each(fn func(K, V))
- func (m Mapper[K, V]) Filter(fn func(K, V) bool) Mapper[K, V]
- func (m Mapper[K, V]) Get(key K) V
- func (m Mapper[K, V]) Has(key K) bool
- func (m Mapper[K, V]) Keys() []K
- func (m Mapper[K, V]) Len() int
- func (m Mapper[K, V]) MapValues(fn func(V) V) Mapper[K, V]
- func (m Mapper[K, V]) OK(key K) (V, bool)
- func (m Mapper[K, V]) Set(key K, value V) Mapper[K, V]
- func (m Mapper[K, V]) Slicer() Slicer[KeyValuePair[K, V]]
- func (m Mapper[K, V]) SortedKeys() []K
- func (m Mapper[K, V]) Values() []V
- type MergeState
- type MergeStateOption
- type Padding
- type Position
- type Renderer
- type Rendition
- type Renditioning
- type RowContext
- type Separators
- type Settings
- type Slicer
- func (s Slicer[T]) Append(elements ...T) Slicer[T]
- func (s Slicer[T]) Clone() Slicer[T]
- func (s Slicer[T]) Contains(fn func(T) bool) bool
- func (s Slicer[T]) Each(fn func(T))
- func (s Slicer[T]) Filter(fn func(T) bool) Slicer[T]
- func (s Slicer[T]) Find(fn func(T) bool) (T, bool)
- func (s Slicer[T]) First() T
- func (s Slicer[T]) Get(index int) T
- func (s Slicer[T]) GetOK(index int) (T, bool)
- func (s Slicer[T]) Has(index int) bool
- func (s Slicer[T]) IsEmpty() bool
- func (s Slicer[T]) Last() T
- func (s Slicer[T]) Len() int
- func (s Slicer[T]) Map(fn func(T) T) Slicer[T]
- func (s Slicer[T]) Prepend(elements ...T) Slicer[T]
- type Spot
- type State
- type StreamConfig
- type Struct
- type StyleName
- type SymbolASCIIdeprecated
- func (s *SymbolASCII) BottomLeft() string
- func (s *SymbolASCII) BottomMid() string
- func (s *SymbolASCII) BottomRight() string
- func (s *SymbolASCII) Center() string
- func (s *SymbolASCII) Column() string
- func (s *SymbolASCII) HeaderLeft() string
- func (s *SymbolASCII) HeaderMid() string
- func (s *SymbolASCII) HeaderRight() string
- func (s *SymbolASCII) MidLeft() string
- func (s *SymbolASCII) MidRight() string
- func (s *SymbolASCII) Name() string
- func (s *SymbolASCII) Row() string
- func (s *SymbolASCII) TopLeft() string
- func (s *SymbolASCII) TopMid() string
- func (s *SymbolASCII) TopRight() string
- type SymbolCustom
- func (c *SymbolCustom) BottomLeft() string
- func (c *SymbolCustom) BottomMid() string
- func (c *SymbolCustom) BottomRight() string
- func (c *SymbolCustom) Center() string
- func (c *SymbolCustom) Column() string
- func (c *SymbolCustom) HeaderLeft() string
- func (c *SymbolCustom) HeaderMid() string
- func (c *SymbolCustom) HeaderRight() string
- func (c *SymbolCustom) MidLeft() string
- func (c *SymbolCustom) MidRight() string
- func (c *SymbolCustom) Name() string
- func (s *SymbolCustom) Preview() string
- func (c *SymbolCustom) Row() string
- func (c *SymbolCustom) TopLeft() string
- func (c *SymbolCustom) TopMid() string
- func (c *SymbolCustom) TopRight() string
- func (c *SymbolCustom) WithBottomLeft(s string) *SymbolCustom
- func (c *SymbolCustom) WithBottomMid(s string) *SymbolCustom
- func (c *SymbolCustom) WithBottomRight(s string) *SymbolCustom
- func (c *SymbolCustom) WithCenter(s string) *SymbolCustom
- func (c *SymbolCustom) WithColumn(s string) *SymbolCustom
- func (c *SymbolCustom) WithHeaderLeft(s string) *SymbolCustom
- func (c *SymbolCustom) WithHeaderMid(s string) *SymbolCustom
- func (c *SymbolCustom) WithHeaderRight(s string) *SymbolCustom
- func (c *SymbolCustom) WithMidLeft(s string) *SymbolCustom
- func (c *SymbolCustom) WithMidRight(s string) *SymbolCustom
- func (c *SymbolCustom) WithRow(s string) *SymbolCustom
- func (c *SymbolCustom) WithTopLeft(s string) *SymbolCustom
- func (c *SymbolCustom) WithTopMid(s string) *SymbolCustom
- func (c *SymbolCustom) WithTopRight(s string) *SymbolCustom
- type SymbolGraphicaldeprecated
- func (s *SymbolGraphical) BottomLeft() string
- func (s *SymbolGraphical) BottomMid() string
- func (s *SymbolGraphical) BottomRight() string
- func (s *SymbolGraphical) Center() string
- func (s *SymbolGraphical) Column() string
- func (s *SymbolGraphical) HeaderLeft() string
- func (s *SymbolGraphical) HeaderMid() string
- func (s *SymbolGraphical) HeaderRight() string
- func (s *SymbolGraphical) MidLeft() string
- func (s *SymbolGraphical) MidRight() string
- func (s *SymbolGraphical) Name() string
- func (s *SymbolGraphical) Row() string
- func (s *SymbolGraphical) TopLeft() string
- func (s *SymbolGraphical) TopMid() string
- func (s *SymbolGraphical) TopRight() string
- type SymbolMarkdowndeprecated
- func (s *SymbolMarkdown) BottomLeft() string
- func (s *SymbolMarkdown) BottomMid() string
- func (s *SymbolMarkdown) BottomRight() string
- func (s *SymbolMarkdown) Center() string
- func (s *SymbolMarkdown) Column() string
- func (s *SymbolMarkdown) HeaderLeft() string
- func (s *SymbolMarkdown) HeaderMid() string
- func (s *SymbolMarkdown) HeaderRight() string
- func (s *SymbolMarkdown) MidLeft() string
- func (s *SymbolMarkdown) MidRight() string
- func (s *SymbolMarkdown) Name() string
- func (s *SymbolMarkdown) Row() string
- func (s *SymbolMarkdown) TopLeft() string
- func (s *SymbolMarkdown) TopMid() string
- func (s *SymbolMarkdown) TopRight() string
- type SymbolMergerdeprecated
- func (s *SymbolMerger) BottomLeft() string
- func (s *SymbolMerger) BottomMid() string
- func (s *SymbolMerger) BottomRight() string
- func (s *SymbolMerger) Center() string
- func (s *SymbolMerger) Column() string
- func (s *SymbolMerger) HeaderLeft() string
- func (s *SymbolMerger) HeaderMid() string
- func (s *SymbolMerger) HeaderRight() string
- func (s *SymbolMerger) MidLeft() string
- func (s *SymbolMerger) MidRight() string
- func (s *SymbolMerger) Name() string
- func (s *SymbolMerger) Row() string
- func (s *SymbolMerger) TopLeft() string
- func (s *SymbolMerger) TopMid() string
- func (s *SymbolMerger) TopRight() string
- type SymbolNothingdeprecated
- func (s *SymbolNothing) BottomLeft() string
- func (s *SymbolNothing) BottomMid() string
- func (s *SymbolNothing) BottomRight() string
- func (s *SymbolNothing) Center() string
- func (s *SymbolNothing) Column() string
- func (s *SymbolNothing) HeaderLeft() string
- func (s *SymbolNothing) HeaderMid() string
- func (s *SymbolNothing) HeaderRight() string
- func (s *SymbolNothing) MidLeft() string
- func (s *SymbolNothing) MidRight() string
- func (s *SymbolNothing) Name() string
- func (s *SymbolNothing) Row() string
- func (s *SymbolNothing) TopLeft() string
- func (s *SymbolNothing) TopMid() string
- func (s *SymbolNothing) TopRight() string
- type SymbolUnicodedeprecated
- func (s *SymbolUnicode) BottomLeft() string
- func (s *SymbolUnicode) BottomMid() string
- func (s *SymbolUnicode) BottomRight() string
- func (s *SymbolUnicode) Center() string
- func (s *SymbolUnicode) Column() string
- func (s *SymbolUnicode) HeaderLeft() string
- func (s *SymbolUnicode) HeaderMid() string
- func (s *SymbolUnicode) HeaderRight() string
- func (s *SymbolUnicode) MidLeft() string
- func (s *SymbolUnicode) MidRight() string
- func (s *SymbolUnicode) Name() string
- func (s *SymbolUnicode) Row() string
- func (s *SymbolUnicode) TopLeft() string
- func (s *SymbolUnicode) TopMid() string
- func (s *SymbolUnicode) TopRight() string
- type Symbols
Constants ¶
const ( Pending = 0 // Operation failed Fail = -1 // Operation failed Success = 1 // Operation succeeded MinimumColumnWidth = 8 DefaultCacheStringCapacity = 10 * 1024 // 10 KB )
Operation Status Constants Used to indicate the success or failure of operations
const ( Empty = "" Skip = "" Space = " " NewLine = "\n" Column = ":" Dash = "-" )
const ( SectionHeader = "header" SectionRow = "row" )
const ( WrapNone = iota // No wrapping WrapNormal // Standard word wrapping WrapTruncate // Truncate text with ellipsis WrapBreak // Break words to fit )
Text Wrapping Constants Defines text wrapping behavior in table cells
const ( MergeNone = iota // No merging MergeVertical // Merge cells vertically MergeHorizontal // Merge cells horizontally MergeBoth // Merge both vertically and horizontally MergeHierarchical // Hierarchical merging )
const ( CharEllipsis = "…" // Ellipsis character for truncation CharBreak = "↩" // Break character for wrapping )
Special Character Constants Defines special characters used in formatting
Variables ¶
var ( // PaddingNone represents explicitly empty padding (no spacing on any side) // Equivalent to Padding{Overwrite: true} PaddingNone = Padding{Left: Empty, Right: Empty, Top: Empty, Bottom: Empty, Overwrite: true} BorderNone = Border{Left: Off, Right: Off, Top: Off, Bottom: Off} LinesNone = Lines{ShowTop: Off, ShowBottom: Off, ShowHeaderLine: Off, ShowFooterLine: Off} SeparatorsNone = Separators{ShowHeader: Off, ShowFooter: Off, BetweenRows: Off, BetweenColumns: Off} )
BorderNone defines a border configuration with all sides disabled.
var PaddingDefault = Padding{Left: " ", Right: " ", Overwrite: true}
PaddingDefault represents standard single-space padding on left/right Equivalent to Padding{Left: " ", Right: " ", Overwrite: true}
var Styles = map[BorderStyle]StyleName{ StyleNone: StyleNameNothing, StyleASCII: StyleNameASCII, StyleLight: StyleNameLight, StyleHeavy: StyleNameHeavy, StyleDouble: StyleNameDouble, StyleDoubleLong: StyleNameDoubleLong, StyleLightHeavy: StyleNameLightHeavy, StyleHeavyLight: StyleNameHeavyLight, StyleLightDouble: StyleNameLightDouble, StyleDoubleLight: StyleNameDoubleLight, StyleRounded: StyleNameRounded, StyleMarkdown: StyleNameMarkdown, StyleGraphical: StyleNameGraphical, StyleMerger: StyleNameMerger, StyleDefault: StyleNameLight, StyleDotted: StyleNameDotted, StyleArrow: StyleNameArrow, StyleStarry: StyleNameStarry, StyleHearts: StyleNameHearts, StyleCircuit: StyleNameCircuit, StyleNature: StyleNameNature, StyleArtistic: StyleNameArtistic, Style8Bit: StyleName8Bit, StyleChaos: StyleNameChaos, StyleDots: StyleNameDots, StyleBlocks: StyleNameBlocks, StyleZen: StyleNameZen, StyleVintage: StyleNameVintage, StyleSketch: StyleNameSketch, StyleArrowDouble: StyleNameArrowDouble, StyleCelestial: StyleNameCelestial, StyleCyber: StyleNameCyber, StyleRunic: StyleNameRunic, StyleIndustrial: StyleNameIndustrial, StyleInk: StyleNameInk, StyleArcade: StyleNameArcade, StyleBlossom: StyleNameBlossom, StyleFrosted: StyleNameFrosted, StyleMosaic: StyleNameMosaic, StyleUFO: StyleNameUFO, StyleSteampunk: StyleNameSteampunk, StyleGalaxy: StyleNameGalaxy, StyleJazz: StyleNameJazz, StylePuzzle: StyleNamePuzzle, StyleHypno: StyleNameHypno, }
Styles maps BorderStyle to StyleName
Functions ¶
func BreakPoint ¶ added in v1.0.1
BreakPoint finds the rune index where the display width of a string first exceeds the specified limit. It returns the number of runes if the entire string fits, or 0 if nothing fits.
func IsIsNumericOrSpace ¶ added in v1.0.1
IsIsNumericOrSpace checks if a rune is a digit or space character. Used in formatting logic to determine safe character replacements.
func IsNumeric ¶ added in v1.0.1
IsNumeric checks if a string represents a valid integer or floating-point number.
func Or ¶ added in v1.0.1
Or provides a ternary-like operation for strings, returning 'valid' if cond is true, else 'inValid'.
func Pad ¶ added in v1.0.4
Pad aligns a string within a specified width using a padding character. It truncates if the string is wider than the target width.
func PadCenter ¶ added in v1.0.1
PadCenter centers a string within a specified width using a padding character. Extra padding is split between left and right, with slight preference to left if uneven.
func PadLeft ¶ added in v1.0.1
PadLeft right-aligns a string within a specified width, filling remaining space on the left with padding.
func PadRight ¶ added in v1.0.1
PadRight left-aligns a string within a specified width, filling remaining space on the right with padding.
func SplitCamelCase ¶ added in v1.0.1
SplitCamelCase splits a camelCase or PascalCase or snake_case string into separate words. It detects transitions between uppercase, lowercase, digits, and other characters.
Types ¶
type Align ¶
type Align string
Align specifies the text alignment within a table cell.
const ( AlignNone Align = "none" // Center-aligned text AlignCenter Align = "center" // Center-aligned text AlignRight Align = "right" // Right-aligned text AlignLeft Align = "left" // Left-aligned text AlignDefault = AlignLeft // Left-aligned text )
Table Alignment Constants Defines text alignment options for table content
type Alignment ¶ added in v1.0.3
type Alignment []Align
type Behavior ¶ added in v1.0.6
type Behavior struct {
AutoHide State // AutoHide determines whether empty columns are hidden. Ignored in streaming mode.
TrimSpace State // TrimSpace enables trimming of leading and trailing spaces from cell content.
TrimLine State // TrimLine determines whether empty visual lines within a cell are collapsed.
Header Control // Header specifies control settings for the table header.
// Compact enables optimized width calculation for merged cells, such as in horizontal merges,
// by systematically determining the most efficient width instead of scaling by the number of columns.
Compact Compact
// Structs contains settings for how struct data is processed.
Structs Struct
}
Behavior defines settings that control table rendering behaviors, such as column visibility and content formatting.
type Border ¶
type Border struct {
Left State // Left border visibility
Right State // Right border visibility
Top State // Top border visibility
Bottom State // Bottom border visibility
Overwrite bool
}
Border defines the visibility states of table borders.
type BorderStyle ¶
type BorderStyle int
BorderStyle defines different border styling options
const ( StyleNone BorderStyle = iota StyleASCII StyleLight StyleHeavy StyleDouble StyleDoubleLong StyleLightHeavy StyleHeavyLight StyleLightDouble StyleDoubleLight StyleRounded StyleMarkdown StyleGraphical StyleMerger StyleDefault StyleDotted StyleArrow StyleStarry StyleHearts StyleCircuit // Renamed from StyleTech StyleNature StyleArtistic Style8Bit StyleChaos StyleDots StyleBlocks StyleZen StyleVintage StyleSketch StyleArrowDouble StyleCelestial StyleCyber StyleRunic StyleIndustrial StyleInk StyleArcade StyleBlossom StyleFrosted StyleMosaic StyleUFO StyleSteampunk StyleGalaxy StyleJazz StylePuzzle StyleHypno )
Border style constants
func (BorderStyle) String ¶
func (s BorderStyle) String() string
String returns the string representation of a border style
type CellAlignment ¶ added in v1.0.7
type CellAlignment struct {
Global Align // Default alignment applied to all cells
PerColumn []Align // Column-specific alignment overrides
}
CellAlignment defines alignment settings for table cells.
type CellCallbacks ¶
type CellCallbacks struct {
Global func() // Global callback applied to all cells
PerColumn []func() // Column-specific callbacks
}
CellCallbacks holds callback functions for cell processing. Note: These are currently placeholders and not fully implemented.
type CellConfig ¶
type CellConfig struct {
Formatting CellFormatting // Cell formatting options
Padding CellPadding // Padding configuration
Callbacks CellCallbacks // Callback functions (unused)
Filter CellFilter // Function to filter cell content (renamed from Filter Filter)
Alignment CellAlignment // Alignment configuration for cells
ColMaxWidths CellWidth // Per-column maximum width overrides
Merging CellMerging // Merging holds all configuration related to cell merging.
// Deprecated: use Alignment.PerColumn instead. Will be removed in a future version.
// will be removed soon
ColumnAligns []Align // Per-column alignment overrides
}
CellConfig combines formatting, padding, and callback settings for a table section.
type CellContext ¶
type CellContext struct {
Data string // Content to be displayed in the cell, provided by the caller
Align Align // Text alignment within the cell (Left, Right, Center, Skip)
Padding Padding // Padding characters surrounding the cell content
Width int // Suggested width (often overridden by Row.Widths)
Merge MergeState // Details about cell spanning across rows or columns
}
CellContext defines the properties and formatting state of an individual table cell.
type CellFilter ¶
type CellFilter struct {
Global func([]string) []string // Processes the entire row
PerColumn []func(string) string // Processes individual cells by column
}
CellFilter defines filtering functions for cell content.
type CellFormatting ¶
type CellFormatting struct {
AutoWrap int // Wrapping behavior (e.g., WrapTruncate, WrapNormal)
AutoFormat State // Enables automatic formatting (e.g., title case for headers)
// Deprecated: Kept for backward compatibility. Use CellConfig.CellMerging.Mode instead.
// This will be removed in a future version.
MergeMode int
// Deprecated: Kept for backward compatibility. Use CellConfig.Alignment instead.
// This will be removed in a future version.
Alignment Align
}
CellFormatting holds formatting options for table cells.
type CellMerging ¶ added in v1.1.1
type CellMerging struct {
// Mode is a bitmask specifying the type of merge (e.g., MergeHorizontal, MergeVertical).
Mode int
// ByColumnIndex specifies which column indices should be considered for merging.
// If the mapper is nil or empty, merging applies to all columns (if Mode is set).
// Otherwise, only columns with an index present as a key will be merged.
ByColumnIndex Mapper[int, bool]
// ByRowIndex is reserved for future features to specify merging on specific rows.
ByRowIndex Mapper[int, bool]
}
CellMerging holds the configuration for how cells should be merged. This new struct replaces the deprecated MergeMode.
type CellPadding ¶
type CellPadding struct {
Global Padding // Default padding applied to all cells
PerColumn []Padding // Column-specific padding overrides
}
CellPadding defines padding settings for table cells.
type CellWidth ¶ added in v1.0.1
func (CellWidth) Constrained ¶ added in v1.0.7
type Compact ¶ added in v1.0.7
type Compact struct {
Merge State // Merge enables compact width calculation during cell merging, optimizing space allocation.
}
Compact configures compact width optimization for merged cells.
type Counter ¶ added in v1.1.0
type Counter interface {
io.Writer // It must be a writer to be used in io.MultiWriter.
Total() int
}
Counter defines an interface that combines io.Writer with a method to retrieve a total. This is used by the WithCounter option to allow for counting lines, bytes, etc.
type Filter ¶
Filter defines a function type for processing cell content. It takes a slice of strings (representing cell data) and returns a processed slice.
type Formatter ¶
type Formatter interface {
Format() string // Returns the formatted string representation
}
Formatter defines an interface for types that can format themselves into a string. Used for custom formatting of table cell content.
type Formatting ¶
type Formatting struct {
Row RowContext // Detailed configuration for the row and its cells
Level Level // Hierarchical level (Header, Body, Footer) affecting line drawing
IsSubRow bool // Marks this as a continuation or padding line in multi-line rows
NormalizedWidths Mapper[int, int]
}
Formatting encapsulates the complete formatting context for a table row. It provides all necessary information to render a row correctly within the table structure.
type Glyphs ¶ added in v1.0.5
type Glyphs struct {
// contains filtered or unexported fields
}
Glyphs provides fully independent border symbols with a corners array
func (*Glyphs) BottomLeft ¶ added in v1.0.5
func (*Glyphs) BottomRight ¶ added in v1.0.5
func (*Glyphs) HeaderLeft ¶ added in v1.0.5
func (*Glyphs) HeaderRight ¶ added in v1.0.5
type KeyValuePair ¶
type KeyValuePair[K comparable, V any] struct { Key K Value V }
KeyValuePair represents a single key-value pair from a Mapper.
type Level ¶
type Level int
Level indicates the vertical position of a line in the table (e.g., header, body, or footer).
type LineCounter ¶ added in v1.1.0
type LineCounter struct {
// contains filtered or unexported fields
}
LineCounter is the default implementation of the Counter interface. It counts the number of newline characters written to it.
func (*LineCounter) Total ¶ added in v1.1.0
func (lc *LineCounter) Total() int
Total implements the Counter interface, returning the final count.
type Lines ¶
type Lines struct {
ShowTop State // Top border visibility
ShowBottom State // Bottom border visibility
ShowHeaderLine State // Header separator line visibility
}
Lines manages the visibility of table boundary lines.
type Location ¶
type Location string
Location specifies the horizontal position of a cell or column within a table row.
type Mapper ¶
type Mapper[K comparable, V any] map[K]V
Mapper is a generic map type with comparable keys and any value type. It provides type-safe operations on maps with additional convenience methods.
func NewBoolMapper ¶ added in v1.1.1
func NewBoolMapper[K comparable](keys ...K) Mapper[K, bool]
func NewIdentityMapper ¶ added in v1.1.1
func NewIdentityMapper[K comparable](keys ...K) Mapper[K, K]
func NewIntMapper ¶ added in v1.1.1
func NewIntMapper[K comparable](keys ...K) Mapper[K, int]
func NewMapper ¶
func NewMapper[K comparable, V any]() Mapper[K, V]
NewMapper creates and returns a new initialized Mapper.
func SlicerToMapper ¶
func SlicerToMapper[K comparable, V any](s Slicer[KeyValuePair[K, V]]) Mapper[K, V]
SlicerToMapper converts a Slicer of KeyValuePair to a Mapper.
func (Mapper[K, V]) Delete ¶
Delete removes the specified key from the map. Does nothing if the key doesn't exist or the map is nil.
func (Mapper[K, V]) Each ¶
func (m Mapper[K, V]) Each(fn func(K, V))
Each iterates over each key-value pair in the map and calls the provided function. Does nothing if the map is nil.
func (Mapper[K, V]) Filter ¶
Filter returns a new Mapper containing only the key-value pairs that satisfy the predicate.
func (Mapper[K, V]) Get ¶
func (m Mapper[K, V]) Get(key K) V
Get returns the value associated with the key. If the key doesn't exist or the map is nil, it returns the zero value for the value type.
func (Mapper[K, V]) Keys ¶
func (m Mapper[K, V]) Keys() []K
Keys returns a slice containing all keys in the map. Returns nil if the map is nil or empty.
func (Mapper[K, V]) Len ¶
Len returns the number of elements in the map. Returns 0 if the map is nil.
func (Mapper[K, V]) MapValues ¶
MapValues returns a new Mapper with the same keys but values transformed by the provided function.
func (Mapper[K, V]) OK ¶
OK returns the value associated with the key and a boolean indicating whether the key exists.
func (Mapper[K, V]) Slicer ¶
func (m Mapper[K, V]) Slicer() Slicer[KeyValuePair[K, V]]
Slicer converts the Mapper to a Slicer of key-value pairs.
func (Mapper[K, V]) SortedKeys ¶ added in v1.0.1
func (m Mapper[K, V]) SortedKeys() []K
type MergeState ¶
type MergeState struct {
Vertical MergeStateOption // Properties for vertical merging (across rows)
Horizontal MergeStateOption // Properties for horizontal merging (across columns)
Hierarchical MergeStateOption // Properties for nested/hierarchical merging
}
MergeState captures how a cell merges across different directions.
type MergeStateOption ¶
type MergeStateOption struct {
Present bool // True if this merge direction is active
Span int // Number of cells this merge spans
Start bool // True if this cell is the starting point of the merge
End bool // True if this cell is the ending point of the merge
}
MergeStateOption represents common attributes for merging in a specific direction.
type Padding ¶
type Padding struct {
Left string
Right string
Top string
Bottom string
// Overwrite forces tablewriter to use this padding configuration exactly as specified,
// even when empty. When false (default), empty Padding fields will inherit defaults.
//
// For explicit no-padding, use the PaddingNone constant instead of setting Overwrite.
Overwrite bool
}
Padding defines the spacing characters around cell content in all four directions. A zero-value Padding struct will use the table's default padding unless Overwrite is true.
func (Padding) Empty ¶ added in v1.0.7
Empty reports whether all padding strings are empty (all fields == ""). Note that an Empty padding may still take effect if Overwrite is true.
func (Padding) Equals ¶ added in v1.0.7
Equals reports whether two Padding configurations are identical in all fields. This includes comparing the Overwrite flag as part of the equality check.
func (Padding) Paddable ¶ added in v1.0.7
Paddable reports whether this Padding configuration should override existing padding. Returns true if either:
- Any padding string is non-empty (!p.Empty())
- Overwrite flag is true (even with all strings empty)
This is used internally during configuration merging to determine whether to apply the padding settings.
type Position ¶
type Position string
Position defines where formatting applies in the table (e.g., header, footer, or rows).
type Renderer ¶
type Renderer interface {
Start(w io.Writer) error
Header(headers [][]string, ctx Formatting) // Renders table header
Row(row []string, ctx Formatting) // Renders a single row
Line(ctx Formatting) // Renders separator line
Config() Rendition // Returns renderer config
Close() error // Gets Rendition form Blueprint
Logger(logger *ll.Logger) // send logger to renderers
}
Renderer defines the interface for rendering tables to an io.Writer. Implementations must handle headers, rows, footers, and separator lines.
type Rendition ¶ added in v1.0.1
type Rendition struct {
Borders Border // Border visibility settings
Symbols Symbols // Symbols used for table drawing
Settings Settings // Rendering behavior settings
Streaming bool
}
Rendition holds the configuration for the default renderer.
type Renditioning ¶ added in v1.0.5
type Renditioning interface {
Rendition(r Rendition)
}
Renditioning has a method to update its rendition. Let's define an optional interface for this.
type RowContext ¶
type RowContext struct {
Position Position // Section of the table (Header, Row, Footer)
Location Location // Boundary position (First, Middle, End)
Current map[int]CellContext // Cells in this row, indexed by column
Previous map[int]CellContext // Cells from the row above; nil if none
Next map[int]CellContext // Cells from the row below; nil if none
Widths Mapper[int, int] // Computed widths for each column
ColMaxWidths CellWidth // Maximum allowed width per column
}
RowContext manages layout properties and relationships for a row and its columns. It maintains state about the current row and its neighbors for proper rendering.
func (RowContext) GetCell ¶ added in v1.0.1
func (r RowContext) GetCell(col int) CellContext
type Separators ¶
type Separators struct {
ShowHeader State // Controls header separator visibility
BetweenRows State // Determines if lines appear between rows
BetweenColumns State // Determines if separators appear between columns
}
Separators controls the visibility of separators in the table.
type Settings ¶
type Settings struct {
Separators Separators // Separator visibility settings
Lines Lines // Line visibility settings
CompactMode State // Reserved for future compact rendering (unused)
}
Settings holds configuration preferences for rendering behavior.
type Slicer ¶
type Slicer[T any] []T
Slicer is a generic slice type that provides additional methods for slice manipulation.
func (Slicer[T]) Contains ¶
Contains returns true if the slice contains an element that satisfies the predicate.
func (Slicer[T]) Each ¶
func (s Slicer[T]) Each(fn func(T))
Each iterates over each element in the slice and calls the provided function. Does nothing if the slice is nil.
func (Slicer[T]) Filter ¶
Filter returns a new Slicer containing only elements that satisfy the predicate.
func (Slicer[T]) Find ¶
Find returns the first element that satisfies the predicate, along with a boolean indicating if it was found.
func (Slicer[T]) First ¶
func (s Slicer[T]) First() T
First returns the first element of the slice, or the zero value if empty.
func (Slicer[T]) Get ¶
Get returns the element at the specified index. Returns the zero value if the index is out of bounds or the slice is nil.
func (Slicer[T]) GetOK ¶
GetOK returns the element at the specified index and a boolean indicating whether the index was valid.
func (Slicer[T]) Last ¶
func (s Slicer[T]) Last() T
Last returns the last element of the slice, or the zero value if empty.
func (Slicer[T]) Len ¶
Len returns the number of elements in the slice. Returns 0 if the slice is nil.
type State ¶
type State int
State represents an on/off state
const ( Unknown State = Pending // Feature is enabled On State = Success // Feature is enabled Off State = Fail // Feature is disabled )
Feature State Constants Represents enabled/disabled states for features
type StreamConfig ¶ added in v1.0.1
type StreamConfig struct {
Enable bool
// StrictColumns, if true, causes Append() to return an error
// in streaming mode if the number of cells in an appended row
// does not match the established number of columns for the stream.
// If false (default), rows with mismatched column counts will be
// padded or truncated with a warning log.
StrictColumns bool
// Deprecated: Use top-level Config.Widths for streaming width control.
// This field will be removed in a future version. It will be respected if
// Config.Widths is not set and this field is.
Widths CellWidth
}
type Struct ¶ added in v1.0.9
type Struct struct {
// AutoHeader automatically extracts and sets headers from struct fields when Bulk is called with a slice of structs.
// Uses JSON tags if present, falls back to field names (title-cased). Skips unexported or json:"-" fields.
// Enabled by default for convenience.
AutoHeader State
// Tags is a priority-ordered list of struct tag keys to check for header names.
// The first tag found on a field will be used. Defaults to ["json", "db"].
Tags []string
}
Struct holds settings for struct-based operations like AutoHeader.
type StyleName ¶ added in v1.0.5
type StyleName string
StyleName defines names for border styles
const ( StyleNameNothing StyleName = "nothing" StyleNameASCII StyleName = "ascii" StyleNameLight StyleName = "light" StyleNameHeavy StyleName = "heavy" StyleNameDouble StyleName = "double" StyleNameDoubleLong StyleName = "doublelong" StyleNameLightHeavy StyleName = "lightheavy" StyleNameHeavyLight StyleName = "heavylight" StyleNameLightDouble StyleName = "lightdouble" StyleNameDoubleLight StyleName = "doublelight" StyleNameRounded StyleName = "rounded" StyleNameMarkdown StyleName = "markdown" StyleNameGraphical StyleName = "graphical" StyleNameMerger StyleName = "merger" StyleNameDotted StyleName = "dotted" StyleNameArrow StyleName = "arrow" StyleNameStarry StyleName = "starry" StyleNameHearts StyleName = "hearts" StyleNameCircuit StyleName = "circuit" // Renamed from Tech StyleNameNature StyleName = "nature" StyleNameArtistic StyleName = "artistic" StyleName8Bit StyleName = "8bit" StyleNameChaos StyleName = "chaos" StyleNameDots StyleName = "dots" StyleNameBlocks StyleName = "blocks" StyleNameZen StyleName = "zen" StyleNameVintage StyleName = "vintage" StyleNameSketch StyleName = "sketch" StyleNameArrowDouble StyleName = "arrowdouble" StyleNameCelestial StyleName = "celestial" StyleNameCyber StyleName = "cyber" StyleNameRunic StyleName = "runic" StyleNameIndustrial StyleName = "industrial" StyleNameInk StyleName = "ink" StyleNameArcade StyleName = "arcade" StyleNameBlossom StyleName = "blossom" StyleNameFrosted StyleName = "frosted" StyleNameMosaic StyleName = "mosaic" StyleNameUFO StyleName = "ufo" StyleNameSteampunk StyleName = "steampunk" StyleNameGalaxy StyleName = "galaxy" StyleNameJazz StyleName = "jazz" StyleNamePuzzle StyleName = "puzzle" StyleNameHypno StyleName = "hypno" )
type SymbolASCII
deprecated
type SymbolASCII struct{}
Deprecated: SymbolASCII is deprecated; use Glyphs with StyleASCII instead. this will be removed soon
func (*SymbolASCII) BottomLeft ¶
func (s *SymbolASCII) BottomLeft() string
func (*SymbolASCII) BottomMid ¶
func (s *SymbolASCII) BottomMid() string
func (*SymbolASCII) BottomRight ¶
func (s *SymbolASCII) BottomRight() string
func (*SymbolASCII) Center ¶
func (s *SymbolASCII) Center() string
func (*SymbolASCII) Column ¶
func (s *SymbolASCII) Column() string
func (*SymbolASCII) HeaderLeft ¶
func (s *SymbolASCII) HeaderLeft() string
func (*SymbolASCII) HeaderMid ¶
func (s *SymbolASCII) HeaderMid() string
func (*SymbolASCII) HeaderRight ¶
func (s *SymbolASCII) HeaderRight() string
func (*SymbolASCII) MidLeft ¶
func (s *SymbolASCII) MidLeft() string
func (*SymbolASCII) MidRight ¶
func (s *SymbolASCII) MidRight() string
func (*SymbolASCII) Row ¶
func (s *SymbolASCII) Row() string
func (*SymbolASCII) TopLeft ¶
func (s *SymbolASCII) TopLeft() string
func (*SymbolASCII) TopMid ¶
func (s *SymbolASCII) TopMid() string
func (*SymbolASCII) TopRight ¶
func (s *SymbolASCII) TopRight() string
type SymbolCustom ¶ added in v1.0.1
type SymbolCustom struct {
// contains filtered or unexported fields
}
SymbolCustom implements the Symbols interface with fully configurable symbols
func NewSymbolCustom ¶ added in v1.0.1
func NewSymbolCustom(name string) *SymbolCustom
NewSymbolCustom creates a new customizable border style
func (*SymbolCustom) BottomLeft ¶ added in v1.0.1
func (c *SymbolCustom) BottomLeft() string
func (*SymbolCustom) BottomMid ¶ added in v1.0.1
func (c *SymbolCustom) BottomMid() string
func (*SymbolCustom) BottomRight ¶ added in v1.0.1
func (c *SymbolCustom) BottomRight() string
func (*SymbolCustom) Center ¶ added in v1.0.1
func (c *SymbolCustom) Center() string
func (*SymbolCustom) Column ¶ added in v1.0.1
func (c *SymbolCustom) Column() string
func (*SymbolCustom) HeaderLeft ¶ added in v1.0.1
func (c *SymbolCustom) HeaderLeft() string
func (*SymbolCustom) HeaderMid ¶ added in v1.0.1
func (c *SymbolCustom) HeaderMid() string
func (*SymbolCustom) HeaderRight ¶ added in v1.0.1
func (c *SymbolCustom) HeaderRight() string
func (*SymbolCustom) MidLeft ¶ added in v1.0.1
func (c *SymbolCustom) MidLeft() string
func (*SymbolCustom) MidRight ¶ added in v1.0.1
func (c *SymbolCustom) MidRight() string
func (*SymbolCustom) Name ¶ added in v1.0.1
func (c *SymbolCustom) Name() string
Implement all Symbols interface methods
func (*SymbolCustom) Preview ¶ added in v1.0.5
func (s *SymbolCustom) Preview() string
Preview renders a small sample table to visualize the border style
func (*SymbolCustom) Row ¶ added in v1.0.1
func (c *SymbolCustom) Row() string
func (*SymbolCustom) TopLeft ¶ added in v1.0.1
func (c *SymbolCustom) TopLeft() string
func (*SymbolCustom) TopMid ¶ added in v1.0.1
func (c *SymbolCustom) TopMid() string
func (*SymbolCustom) TopRight ¶ added in v1.0.1
func (c *SymbolCustom) TopRight() string
func (*SymbolCustom) WithBottomLeft ¶ added in v1.0.1
func (c *SymbolCustom) WithBottomLeft(s string) *SymbolCustom
func (*SymbolCustom) WithBottomMid ¶ added in v1.0.1
func (c *SymbolCustom) WithBottomMid(s string) *SymbolCustom
func (*SymbolCustom) WithBottomRight ¶ added in v1.0.1
func (c *SymbolCustom) WithBottomRight(s string) *SymbolCustom
func (*SymbolCustom) WithCenter ¶ added in v1.0.1
func (c *SymbolCustom) WithCenter(s string) *SymbolCustom
Builder methods for fluent configuration
func (*SymbolCustom) WithColumn ¶ added in v1.0.1
func (c *SymbolCustom) WithColumn(s string) *SymbolCustom
func (*SymbolCustom) WithHeaderLeft ¶ added in v1.0.1
func (c *SymbolCustom) WithHeaderLeft(s string) *SymbolCustom
func (*SymbolCustom) WithHeaderMid ¶ added in v1.0.1
func (c *SymbolCustom) WithHeaderMid(s string) *SymbolCustom
func (*SymbolCustom) WithHeaderRight ¶ added in v1.0.1
func (c *SymbolCustom) WithHeaderRight(s string) *SymbolCustom
func (*SymbolCustom) WithMidLeft ¶ added in v1.0.1
func (c *SymbolCustom) WithMidLeft(s string) *SymbolCustom
func (*SymbolCustom) WithMidRight ¶ added in v1.0.1
func (c *SymbolCustom) WithMidRight(s string) *SymbolCustom
func (*SymbolCustom) WithRow ¶ added in v1.0.1
func (c *SymbolCustom) WithRow(s string) *SymbolCustom
func (*SymbolCustom) WithTopLeft ¶ added in v1.0.1
func (c *SymbolCustom) WithTopLeft(s string) *SymbolCustom
func (*SymbolCustom) WithTopMid ¶ added in v1.0.1
func (c *SymbolCustom) WithTopMid(s string) *SymbolCustom
func (*SymbolCustom) WithTopRight ¶ added in v1.0.1
func (c *SymbolCustom) WithTopRight(s string) *SymbolCustom
type SymbolGraphical
deprecated
type SymbolGraphical struct{}
Deprecated: SymbolGraphical is deprecated; use Glyphs with StyleGraphical instead. this will be removed soon
func (*SymbolGraphical) BottomLeft ¶
func (s *SymbolGraphical) BottomLeft() string
func (*SymbolGraphical) BottomMid ¶
func (s *SymbolGraphical) BottomMid() string
func (*SymbolGraphical) BottomRight ¶
func (s *SymbolGraphical) BottomRight() string
func (*SymbolGraphical) Center ¶
func (s *SymbolGraphical) Center() string
func (*SymbolGraphical) Column ¶
func (s *SymbolGraphical) Column() string
func (*SymbolGraphical) HeaderLeft ¶
func (s *SymbolGraphical) HeaderLeft() string
func (*SymbolGraphical) HeaderMid ¶
func (s *SymbolGraphical) HeaderMid() string
func (*SymbolGraphical) HeaderRight ¶
func (s *SymbolGraphical) HeaderRight() string
func (*SymbolGraphical) MidLeft ¶
func (s *SymbolGraphical) MidLeft() string
func (*SymbolGraphical) MidRight ¶
func (s *SymbolGraphical) MidRight() string
func (*SymbolGraphical) Name ¶
func (s *SymbolGraphical) Name() string
SymbolGraphical symbol methods
func (*SymbolGraphical) Row ¶
func (s *SymbolGraphical) Row() string
func (*SymbolGraphical) TopLeft ¶
func (s *SymbolGraphical) TopLeft() string
func (*SymbolGraphical) TopMid ¶
func (s *SymbolGraphical) TopMid() string
func (*SymbolGraphical) TopRight ¶
func (s *SymbolGraphical) TopRight() string
type SymbolMarkdown
deprecated
type SymbolMarkdown struct{}
Deprecated: SymbolMarkdown is deprecated; use Glyphs with StyleMarkdown instead. this will be removed soon
func (*SymbolMarkdown) BottomLeft ¶
func (s *SymbolMarkdown) BottomLeft() string
func (*SymbolMarkdown) BottomMid ¶
func (s *SymbolMarkdown) BottomMid() string
func (*SymbolMarkdown) BottomRight ¶
func (s *SymbolMarkdown) BottomRight() string
func (*SymbolMarkdown) Center ¶
func (s *SymbolMarkdown) Center() string
func (*SymbolMarkdown) Column ¶
func (s *SymbolMarkdown) Column() string
func (*SymbolMarkdown) HeaderLeft ¶
func (s *SymbolMarkdown) HeaderLeft() string
func (*SymbolMarkdown) HeaderMid ¶
func (s *SymbolMarkdown) HeaderMid() string
func (*SymbolMarkdown) HeaderRight ¶
func (s *SymbolMarkdown) HeaderRight() string
func (*SymbolMarkdown) MidLeft ¶
func (s *SymbolMarkdown) MidLeft() string
func (*SymbolMarkdown) MidRight ¶
func (s *SymbolMarkdown) MidRight() string
func (*SymbolMarkdown) Row ¶
func (s *SymbolMarkdown) Row() string
func (*SymbolMarkdown) TopLeft ¶
func (s *SymbolMarkdown) TopLeft() string
func (*SymbolMarkdown) TopMid ¶
func (s *SymbolMarkdown) TopMid() string
func (*SymbolMarkdown) TopRight ¶
func (s *SymbolMarkdown) TopRight() string
type SymbolMerger
deprecated
type SymbolMerger struct {
// contains filtered or unexported fields
}
Deprecated: SymbolMerger is deprecated; use Glyphs with StyleMerger instead. this will be removed soon
func (*SymbolMerger) BottomLeft ¶
func (s *SymbolMerger) BottomLeft() string
func (*SymbolMerger) BottomMid ¶
func (s *SymbolMerger) BottomMid() string
func (*SymbolMerger) BottomRight ¶
func (s *SymbolMerger) BottomRight() string
func (*SymbolMerger) Center ¶
func (s *SymbolMerger) Center() string
func (*SymbolMerger) Column ¶
func (s *SymbolMerger) Column() string
func (*SymbolMerger) HeaderLeft ¶
func (s *SymbolMerger) HeaderLeft() string
func (*SymbolMerger) HeaderMid ¶
func (s *SymbolMerger) HeaderMid() string
func (*SymbolMerger) HeaderRight ¶
func (s *SymbolMerger) HeaderRight() string
func (*SymbolMerger) MidLeft ¶
func (s *SymbolMerger) MidLeft() string
func (*SymbolMerger) MidRight ¶
func (s *SymbolMerger) MidRight() string
func (*SymbolMerger) Row ¶
func (s *SymbolMerger) Row() string
func (*SymbolMerger) TopLeft ¶
func (s *SymbolMerger) TopLeft() string
func (*SymbolMerger) TopMid ¶
func (s *SymbolMerger) TopMid() string
func (*SymbolMerger) TopRight ¶
func (s *SymbolMerger) TopRight() string
type SymbolNothing
deprecated
type SymbolNothing struct{}
Deprecated: SymbolNothing is deprecated; use Glyphs with StyleNone instead. this will be removed soon
func (*SymbolNothing) BottomLeft ¶
func (s *SymbolNothing) BottomLeft() string
func (*SymbolNothing) BottomMid ¶
func (s *SymbolNothing) BottomMid() string
func (*SymbolNothing) BottomRight ¶
func (s *SymbolNothing) BottomRight() string
func (*SymbolNothing) Center ¶
func (s *SymbolNothing) Center() string
func (*SymbolNothing) Column ¶
func (s *SymbolNothing) Column() string
func (*SymbolNothing) HeaderLeft ¶
func (s *SymbolNothing) HeaderLeft() string
func (*SymbolNothing) HeaderMid ¶
func (s *SymbolNothing) HeaderMid() string
func (*SymbolNothing) HeaderRight ¶
func (s *SymbolNothing) HeaderRight() string
func (*SymbolNothing) MidLeft ¶
func (s *SymbolNothing) MidLeft() string
func (*SymbolNothing) MidRight ¶
func (s *SymbolNothing) MidRight() string
func (*SymbolNothing) Row ¶
func (s *SymbolNothing) Row() string
func (*SymbolNothing) TopLeft ¶
func (s *SymbolNothing) TopLeft() string
func (*SymbolNothing) TopMid ¶
func (s *SymbolNothing) TopMid() string
func (*SymbolNothing) TopRight ¶
func (s *SymbolNothing) TopRight() string
type SymbolUnicode
deprecated
type SymbolUnicode struct {
// contains filtered or unexported fields
}
Deprecated: SymbolUnicode is deprecated; use Glyphs with appropriate styles (e.g., StyleLight, StyleHeavy) instead. this will be removed soon
func (*SymbolUnicode) BottomLeft ¶
func (s *SymbolUnicode) BottomLeft() string
func (*SymbolUnicode) BottomMid ¶
func (s *SymbolUnicode) BottomMid() string
func (*SymbolUnicode) BottomRight ¶
func (s *SymbolUnicode) BottomRight() string
func (*SymbolUnicode) Center ¶
func (s *SymbolUnicode) Center() string
func (*SymbolUnicode) Column ¶
func (s *SymbolUnicode) Column() string
func (*SymbolUnicode) HeaderLeft ¶
func (s *SymbolUnicode) HeaderLeft() string
func (*SymbolUnicode) HeaderMid ¶
func (s *SymbolUnicode) HeaderMid() string
func (*SymbolUnicode) HeaderRight ¶
func (s *SymbolUnicode) HeaderRight() string
func (*SymbolUnicode) MidLeft ¶
func (s *SymbolUnicode) MidLeft() string
func (*SymbolUnicode) MidRight ¶
func (s *SymbolUnicode) MidRight() string
func (*SymbolUnicode) Row ¶
func (s *SymbolUnicode) Row() string
func (*SymbolUnicode) TopLeft ¶
func (s *SymbolUnicode) TopLeft() string
func (*SymbolUnicode) TopMid ¶
func (s *SymbolUnicode) TopMid() string
func (*SymbolUnicode) TopRight ¶
func (s *SymbolUnicode) TopRight() string
type Symbols ¶
type Symbols interface {
// Name returns the style name
Name() string
// Basic component symbols
Center() string // Junction symbol (where lines cross)
Row() string // Horizontal line symbol
Column() string // Vertical line symbol
// Corner and junction symbols
TopLeft() string // LevelHeader-left corner
TopMid() string // LevelHeader junction
TopRight() string // LevelHeader-right corner
MidLeft() string // Left junction
MidRight() string // Right junction
BottomLeft() string // LevelFooter-left corner
BottomMid() string // LevelFooter junction
BottomRight() string // LevelFooter-right corner
// Optional header-specific symbols
HeaderLeft() string
HeaderMid() string
HeaderRight() string
}
Symbols defines the interface for table border symbols
func NewSymbols ¶
func NewSymbols(style BorderStyle) Symbols
NewSymbols creates a new Symbols instance with the specified style