You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: table.go
    path of file: ./repos/cointop/pkg/table
    
    the code of the file until where you have to start completion: package table

import (
	"fmt"
	"io"
	"sort"
	"strings"
	"unicode/utf8"

	"github.com/acarl005/stripansi"
	"github.com/cointop-sh/cointop/pkg/pad"
	"github.com/cointop-sh/cointop/pkg/table/align"
)

// Table table
type Table struct {
	cols             Cols
	rows             Rows
	sort             []SortBy
	width            int
	HideColumHeaders bool
}

// NewTable new table
func NewTable() *Table {
	return &Table{}
}

// SetWidth set table width
func (t *Table) SetWidth(w int) *Table {
	t.width = w
	return t
}

// AddCol add column
func (t *Table) AddCol(n string) *Col {
	c := &Col{name: n}
	t.cols = append(t.cols, c)
	return c
}

// AddRow add row
func (t *Table) AddRow(v ...interface{}) *Row {
	r := &Row{table: t, values: v, strValues: make([]string, len(v))}
	t.rows = append(t.rows, r)
	return r
}

// AddRowCells add row using cells
func (t *Table) AddRowCells(cells ...*RowCell) *Row {
	t.SetNumCol(len(cells))
	v := make([]interface{}, len(cells))
	for i, item := range cells {
	
    
func (t *Table) Format() *Table {
	for _, c := range t.cols {
		s := stripansi.Strip(c.name)
		c.width = utf8.RuneCountInString(s) + 1
		if c.minWidth > c.width {
			c.width = c.minWidth
		}
	}

	for _, r := range t.rows {
		for j, v := range r.values {
			c := t.cols[j]

			if c.hide {
				continue
			}

			if c.formatFn != nil {
				r.strValues[j] = fmt.Sprintf("%s", c.formatFn(v))
			} else if c.format != "" {
				r.strValues[j] = fmt.Sprintf(c.format, v)
			} else {
				r.strValues[j] = fmt.Sprintf("%v", v)
			}

			s := stripansi.Strip(r.strValues[j])
			runeCount := utf8.RuneCountInString(s)
			if runeCount > t.cols[j].width {
				t.cols[j].width = runeCount
			}
		}
	}

	//t.normalizeColWidthPerc()
	unused := t.width - t.colWidth()
	if unused <= 0 {
		return t
	}

	for _, c := range t.cols {
		if c.hide {
			continue
		}

		if c.perc > 0 {
			c.width += int(float32(unused) * c.perc)
		}
	}

	var i int
	for i = len(t.cols) - 1; i >= 0; i-- {
		if t.cols[i].hide {
			continue
		}

		break
	}

	if len(t.cols) > 0 {
		t.cols[i].width += t.width - t.colWidth()
	}

	return t
}