gobular

package module
v0.0.0-...-da0a395 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2017 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSetup = Setup{'│', '─', '┼', '┬', '┴', '├', '┤', '┌', '┐', '└', '┘'}
)

Functions

This section is empty.

Types

type Alignment

type Alignment int
const (
	HAlignLeft Alignment = iota
	HAlignCenter
	HAlignRight
)

type Cell

type Cell struct {
	// Content is an array of lines in this cell.
	Content []string

	// ColSpan specifies how many cells this one should span. If you have a
	// table with four columns and the first cell should be 2 columns wide, set
	// this to 2 in the first cell and do not use the second cell, it will be
	// ignored. So your Cells array in the row still has four elements. Setting
	// ColSpan to 0 or 1 has the same default effect of just spanning one cell.
	//
	// The WidthMin and WidthMax properties of cells with ColSpan > 1 will be
	// ignoered. Setting restrictions for such cells is not possible currently.
	ColSpan uint
	HAlign  Alignment

	WidthMin uint32
	WidthMax uint32
	// contains filtered or unexported fields
}

type Row

type Row struct {
	Cells []Cell
}

type Setup

type Setup struct {
	GridVBar        rune
	GridHBar        rune
	GridCross       rune
	GridTop         rune
	GridBottom      rune
	GridLeft        rune
	GridRight       rune
	GridTopLeft     rune
	GridTopRight    rune
	GridBottomLeft  rune
	GridBottomRight rune
}

type Table

type Table struct {
	Setup
	Caption      string
	EmbedCaption bool
	Rows         []Row
}

func NewTable

func NewTable() *Table

func (*Table) Render

func (t *Table) Render() (lines []string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL