Documentation
¶
Index ¶
- Constants
- func Blue(content string) string
- func CreateColoredCell(content string, color int) string
- func Green(content string) string
- func Print(header []string, body [][]string)
- func PrintWithOptions(writer io.Writer, header []string, body [][]string, options TableOptions)
- func PrintWithWriter(writer io.Writer, header []string, body [][]string)
- func Red(content string) string
- func RenderToString(header []string, body [][]string) string
- func Yellow(content string) string
- type TableOptions
Constants ¶
View Source
const ( // Color constants for ANSI colors ColorBlack = 0 ColorRed = 1 ColorGreen = 2 ColorYellow = 3 ColorBlue = 4 ColorMagenta = 5 ColorCyan = 6 ColorWhite = 7 )
Colors for styling table content
Variables ¶
This section is empty.
Functions ¶
func CreateColoredCell ¶
CreateColoredCell returns a cell with the specified color
func PrintWithOptions ¶
func PrintWithOptions(writer io.Writer, header []string, body [][]string, options TableOptions)
PrintWithOptions outputs a table with the provided configuration options
func PrintWithWriter ¶
PrintWithWriter outputs a table to the provided writer with default styling
func RenderToString ¶
RenderToString renders a table and returns it as a string
Types ¶
type TableOptions ¶
type TableOptions struct {
// AutoWrapText controls text wrapping in cells
AutoWrapText bool
// AutoFormatHeaders controls header formatting
AutoFormatHeaders bool
// HeaderAlignment sets the alignment for header cells
HeaderAlignment int
// CellAlignment sets the alignment for non-header cells
CellAlignment int
// UseBorders enables table borders
UseBorders bool
// Padding sets the padding between columns
Padding string
FooterData []string
// Caption sets a caption for the table
Caption string
}
TableOptions provides configuration for table rendering
func DefaultOptions ¶
func DefaultOptions() TableOptions
DefaultOptions returns the default table formatting options
Click to show internal directories.
Click to hide internal directories.