mdtable

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mdtable helps construct markdown tables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment string

Alignment specifies a column alignment.

const (
	DefaultAlignment Alignment = ""
	Left             Alignment = ":--"
	Right            Alignment = "--:"
	Center           Alignment = ":-:"
)

Valid Alignment values.

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder helps construct a Markdown table.

func (*Builder) AddRow

func (b *Builder) AddRow(row []string) *Builder

AddRow adds a given markdown literals as contents of a row.

func (*Builder) Build

func (b *Builder) Build() string

func (*Builder) BuildCSV

func (b *Builder) BuildCSV() string

BuildCSV returns the table as a CSV.

func (*Builder) SetAlignment

func (b *Builder) SetAlignment(colAlignments []Alignment) *Builder

SetAlignment sets the alignment of the columns.

func (*Builder) SetHeader

func (b *Builder) SetHeader(cells []string) *Builder

SetHeader sets the header cell contents of the table.

Jump to

Keyboard shortcuts

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