Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the problem that the column color cannot be set without setting the header #211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asjdf
Copy link

@asjdf asjdf commented Mar 3, 2023

Fix the problem that the column background color cannot be set without setting the header (SetHeader).

For Example:

tData := [][]string{
	{"Name", "Heat Unit", "Peppers"},
	{"Bell Pepper", "0", "0"},
}
table := tablewriter.NewWriter(tStr)
table.AppendBulk(tData)
tColColor := make([]tablewriter.Colors, 0)
for i := 0; i < len(data); i++ {
	tColColor = append(tColColor, tablewriter.Colors{tablewriter.Normal, tablewriter.FgHiWhiteColor})
}
table.SetColumnColor(tColColor...)

@olekukonko
Copy link
Owner

@asjdf can we have some test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants