clitable/table.go
func (t *Table) String(title string) string {

	tableString := []string{}

	if len(t.Rows) == 0 && t.Footer == nil {
		return ""
	}

	tableString = append(tableString, "### "+title)

	t.calculateSizes(t.Footer)

	if !t.Markdown {
		// t.printDash()
		tableString = append(tableString, t.stringDash())
	}

	if !t.HideHead {
		tableString = append(tableString, t.getHead())
		tableString = append(tableString, t.stringTableDash())
		// fmt.Println(t.getHead())
		// t.printTableDash()
	}

	for _, r := range t.Rows {
		// fmt.Println(t.rowString(r))
		tableString = append(tableString, t.rowString(r))
		if !t.Markdown {
			tableString = append(tableString, t.stringDash())
		}
	}

	if t.Footer != nil {
		tableString = append(tableString, t.stringTableDash())
		tableString = append(tableString, t.rowString(t.Footer))
		if !t.Markdown {
			tableString = append(tableString, t.stringDash())
		}
	}

	return strings.Join(tableString[:], "\n")
}
func (t *Table) String(title string) string {

	tableString := []string{}

	if len(t.Rows) == 0 && t.Footer == nil {
		return ""
	}

	tableString = append(tableString, "### "+title)

	t.calculateSizes(t.Footer)

	if !t.Markdown {
		// t.printDash()
		tableString = append(tableString, t.stringDash())
	}

	if !t.HideHead {
		tableString = append(tableString, t.getHead())
		tableString = append(tableString, t.stringTableDash())
		// fmt.Println(t.getHead())
		// t.printTableDash()
	}

	for _, r := range t.Rows {
		// fmt.Println(t.rowString(r))
		tableString = append(tableString, t.rowString(r))
		if !t.Markdown {
			tableString = append(tableString, t.stringDash())
		}
	}

	if t.Footer != nil {
		tableString = append(tableString, t.stringTableDash())
		tableString = append(tableString, t.rowString(t.Footer))
		if !t.Markdown {
			tableString = append(tableString, t.stringDash())
		}
	}

	return strings.Join(tableString[:], "\n")
}
// String - Ouput table as a string.