We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
package main import ( "github.com/olekukonko/tablewriter" "os" "strings" ) func main() { lines := []string{ "Lorem ipsum dolor", "quis commodo odio", } linesWithNewline := strings.Join(lines, "\n") data := [][]string{ {" ", "b", "c"}, {" ", "e", linesWithNewline}, } table := tablewriter.NewWriter(os.Stdout) table.SetHeader([]string{"", "", "col2"}) table.SetAlignment(tablewriter.ALIGN_LEFT) table.SetBorder(false) table.SetColMinWidth(2, 15) table.SetAutoWrapText(false) table.SetRowLine(true) table.AppendBulk(data) table.Render() }
Results in
| | COL2 ----+---+-------------------- | b | c ----+---+-------------------- | e | Lorem ipsum dolor | | quis commodo odio ----+---+--------------------
Instead of the expected
The text was updated successfully, but these errors were encountered:
Patch #187
Workaround: Ensure your headers are at least two spaces instead of empty. In the example above, replace
table.SetHeader([]string{"", "", "col2"})
with
table.SetHeader([]string{" ", " ", "col2"})
Sorry, something went wrong.
No branches or pull requests
Results in
Instead of the expected
The text was updated successfully, but these errors were encountered: