Documentation
¶
Index ¶
- type Blueprint
- func (f *Blueprint) Close() error
- func (f *Blueprint) Config() tw.Rendition
- func (f *Blueprint) Footer(footers [][]string, ctx tw.Formatting)
- func (f *Blueprint) Header(headers [][]string, ctx tw.Formatting)
- func (f *Blueprint) Line(ctx tw.Formatting)
- func (f *Blueprint) Logger(logger *ll.Logger)
- func (f *Blueprint) Rendition(config tw.Rendition)
- func (f *Blueprint) Row(row []string, ctx tw.Formatting)
- func (f *Blueprint) Start(w io.Writer) error
- type Colorized
- func (c *Colorized) Close() error
- func (c *Colorized) Config() tw.Rendition
- func (c *Colorized) Debug() []string
- func (c *Colorized) Footer(footers [][]string, ctx tw.Formatting)
- func (c *Colorized) Header(headers [][]string, ctx tw.Formatting)
- func (c *Colorized) Line(ctx tw.Formatting)
- func (c *Colorized) Logger(logger *ll.Logger)
- func (c *Colorized) Rendition(newRendition tw.Rendition)
- func (c *Colorized) Reset()
- func (c *Colorized) Row(row []string, ctx tw.Formatting)
- func (c *Colorized) Start(w io.Writer) error
- type ColorizedConfig
- type Colors
- type HTML
- func (h *HTML) Close() error
- func (h *HTML) Config() tw.Rendition
- func (h *HTML) Debug() []string
- func (h *HTML) Footer(footers [][]string, ctx tw.Formatting)
- func (h *HTML) Header(headers [][]string, ctx tw.Formatting)
- func (h *HTML) Line(ctx tw.Formatting)
- func (h *HTML) Logger(logger *ll.Logger)
- func (h *HTML) Reset()
- func (h *HTML) Row(row []string, ctx tw.Formatting)
- func (h *HTML) Start(w io.Writer) error
- type HTMLConfig
- type Junction
- type JunctionContext
- type Markdown
- func (m *Markdown) Close() error
- func (m *Markdown) Config() tw.Rendition
- func (m *Markdown) Footer(footers [][]string, ctx tw.Formatting)
- func (m *Markdown) Header(headers [][]string, ctx tw.Formatting)
- func (m *Markdown) Line(ctx tw.Formatting)
- func (m *Markdown) Logger(logger *ll.Logger)
- func (m *Markdown) Rendition(config tw.Rendition)
- func (m *Markdown) Reset()
- func (m *Markdown) Row(row []string, ctx tw.Formatting)
- func (m *Markdown) Start(w io.Writer) error
- type Ocean
- func (o *Ocean) Close() error
- func (o *Ocean) Config() tw.Rendition
- func (o *Ocean) Footer(footers [][]string, ctx tw.Formatting)
- func (o *Ocean) Header(headers [][]string, ctx tw.Formatting)
- func (o *Ocean) Line(ctx tw.Formatting)
- func (o *Ocean) Logger(logger *ll.Logger)
- func (o *Ocean) Rendition(config tw.Rendition)
- func (o *Ocean) Row(row []string, ctx tw.Formatting)
- func (o *Ocean) Start(w io.Writer) error
- type OceanConfig
- type SVG
- func (s *SVG) Close() error
- func (s *SVG) Config() tw.Rendition
- func (s *SVG) Debug() []string
- func (s *SVG) Footer(footers [][]string, ctx tw.Formatting)
- func (s *SVG) Header(headers [][]string, ctx tw.Formatting)
- func (s *SVG) Line(ctx tw.Formatting)
- func (s *SVG) Logger(logger *ll.Logger)
- func (s *SVG) Reset()
- func (s *SVG) Row(rowLine []string, ctx tw.Formatting)
- func (s *SVG) Start(w io.Writer) error
- type SVGConfig
- type Tint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blueprint ¶
type Blueprint struct {
// contains filtered or unexported fields
}
Blueprint implements a primary table rendering engine with customizable borders and alignments.
func NewBlueprint ¶
NewBlueprint creates a new Blueprint instance with optional custom configurations.
func (*Blueprint) Footer ¶
func (f *Blueprint) Footer(footers [][]string, ctx tw.Formatting)
Footer renders the table footer section with configured formatting.
func (*Blueprint) Header ¶
func (f *Blueprint) Header(headers [][]string, ctx tw.Formatting)
Header renders the table header section with configured formatting.
func (*Blueprint) Line ¶
func (f *Blueprint) Line(ctx tw.Formatting)
Line renders a full horizontal row line with junctions and segments.
type Colorized ¶
type Colorized struct {
// contains filtered or unexported fields
}
Colorized renders colored ASCII tables with customizable borders, colors, and alignments.
func NewColorized ¶
func NewColorized(configs ...ColorizedConfig) *Colorized
NewColorized creates a Colorized renderer with the specified configuration, falling back to defaults if none provided. Only the first config is used if multiple are passed.
func (*Colorized) Footer ¶
func (c *Colorized) Footer(footers [][]string, ctx tw.Formatting)
Footer renders the table footer with configured colors and formatting.
func (*Colorized) Header ¶
func (c *Colorized) Header(headers [][]string, ctx tw.Formatting)
Header renders the table header with configured colors and formatting.
func (*Colorized) Line ¶
func (c *Colorized) Line(ctx tw.Formatting)
Line renders a horizontal row line with colored junctions and segments, skipping zero-width columns.
func (*Colorized) Rendition ¶ added in v1.0.5
Rendition updates the parts of ColorizedConfig that correspond to tw.Rendition by merging the provided newRendition. Color-specific Tints are not modified.
func (*Colorized) Reset ¶
func (c *Colorized) Reset()
Reset clears the renderer's internal state, including debug traces.
type ColorizedConfig ¶
type ColorizedConfig struct {
Borders tw.Border // Border visibility settings
Settings tw.Settings // Rendering behavior settings (e.g., separators, whitespace)
Header Tint // Colors for header cells
Column Tint // Colors for row cells
Border Tint // Colors for borders and lines
Separator Tint // Colors for column separators
Symbols tw.Symbols // Symbols for table drawing (e.g., corners, lines)
}
ColorizedConfig holds configuration for the Colorized table renderer.
type Colors ¶
Colors is a slice of color attributes for use with fatih/color, such as color.FgWhite or color.Bold.
func BgRGB ¶ added in v1.1.5
BgRGB returns background Colors for a 24-bit ("true color") value. It behaves like RGB but sets the background rather than the foreground.
func Hex ¶ added in v1.1.5
Hex parses a hexadecimal color string and returns foreground Colors for the equivalent 24-bit color. Both the shorthand "#RGB" and full "#RRGGBB" forms are accepted, with or without the leading '#'. An error is returned for strings that are not a valid hex color.
func RGB ¶ added in v1.1.5
RGB returns foreground Colors for a 24-bit ("true color") value. Each of r, g and b is a channel in the range 0-255; values outside that range are clamped.
The result is a plain Colors slice, so it can be used anywhere Colors are accepted and combined with regular attributes via append, for example:
Tint{FG: append(renderer.RGB(255, 128, 0), color.Bold)}
Terminals that do not support 24-bit color may ignore or approximate the sequence.
type HTML ¶
type HTML struct {
// contains filtered or unexported fields
}
HTML renders tables in HTML format with customizable classes and content handling.
func NewHTML ¶
func NewHTML(configs ...HTMLConfig) *HTML
NewHTML initializes an HTML renderer with the given w, debug setting, and optional configuration. It panics if the w is nil and applies defaults for unset config fields. Update: see https://github.com/olekukonko/tablewriter/issues/258
func (*HTML) Close ¶
Close ensures all open HTML tags (