func Print(table Table) error {
	var buf bytes.Buffer
	Fprint(&buf, table)

	// attempt to get terminal size
	size, err := ts.GetSize()

	// if table height is less than terminal height,
	// print normally.
	if err != nil || len(table.Body) < size.Row()-2 {
		_, err := buf.WriteTo(os.Stdout)
		return err
	}

	// otherwise pipe to less (or more for windows).
	command := "less"
	if runtime.GOOS == "windows" {
		command = "more"
	}

	// if less (or more) is not found, print normally.
	if _, err := exec.LookPath(command); err != nil {
		_, err := buf.WriteTo(os.Stdout)
		return err
	}

	cmd := exec.Command(command)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	cmd.Stdin = &buf
	return cmd.Run()
}
// Print prints the table to stdout.
// It pipes to less (or more for windows) if
// height of table is higher than terminal's.
Print prints the table to stdout.
It pipes to less (or more for windows) if
height of table is higher than terminal's.
// Print prints the table to stdout . // It pipes to less ( or more for windows ) if // height of table is higher than terminal ' s .
func Print(table Table) error {
	var buf bytes.Buffer
	Fprint(&buf, table)
	size, err := ts.GetSize()
	if err != nil || len(table.Body) < size.Row()-2 {
		_, err := buf.WriteTo(os.Stdout)
		return err
	}
	command := "less"
	if runtime.GOOS == "windows" {
		command = "more"
	}
	if _, err := exec.LookPath(command); err != nil {
		_, err := buf.WriteTo(os.Stdout)
		return err
	}
	cmd := exec.Command(command)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	cmd.Stdin = &buf
	return cmd.Run()
}
func Print ( table Table ) error { var buf bytes . Buffer Fprint ( & buf , table ) size , err := ts . GetSize ( ) if err != nil || len ( table . Body ) < size . Row ( ) - 2 { _ , err := buf . WriteTo ( os . Stdout ) return err } command := " " if runtime . GOOS == " " { command = " " } if _ , err := exec . LookPath ( command ) ; err != nil { _ , err := buf . WriteTo ( os . Stdout ) return err } cmd := exec . Command ( command ) cmd . Stdout = os . Stdout cmd . Stderr = os . Stderr cmd . Stdin = & buf return cmd . Run ( ) }
Print prints the table to stdout.
Print prints the table to stdout .
// attempt to get terminal size // if table height is less than terminal height, // print normally. // otherwise pipe to less (or more for windows). // if less (or more) is not found, print normally.