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

Column separator is not aligned #174

Open
choleraehyq opened this issue Dec 14, 2020 · 3 comments
Open

Column separator is not aligned #174

choleraehyq opened this issue Dec 14, 2020 · 3 comments

Comments

@choleraehyq
Copy link

package main

import (
	"os"

	"github.com/olekukonko/tablewriter"
)

func main() {
	data := [][]string{
		{"trace", "14:25:54.123022", "192.219µs"},
		{"  └─traceRun", "14:25:54.123035", "175.245µs"},
		{"    ├─traceRunChild1", "14:25:54.123036", "2.075µs"},
		{"    └─traceRunChild2", "14:25:54.123204", "784ns"},
	}
	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader([]string{"operation", "startTS", "duration"})
	table.SetAlignment(tablewriter.ALIGN_LEFT)
	table.AppendBulk(data)
	table.Render() // Send output
}

will got

+------------------------+-----------------+-----------+
|       OPERATION        |     STARTTS     | DURATION  |
+------------------------+-----------------+-----------+
| trace                  | 14:25:54.123022 | 192.219µs |
|   └─traceRun         | 14:25:54.123035 | 175.245µs |
|     ├─traceRunChild1 | 14:25:54.123036 | 2.075µs   |
|     └─traceRunChild2 | 14:25:54.123204 | 784ns     |
+------------------------+-----------------+-----------+

which is not aligned.

@olekukonko
Copy link
Owner

Goo find do you want to submit a patch ?

@choleraehyq
Copy link
Author

Well, I haven't find the reason yet.

@eze-kiel
Copy link

Is it still an issue @choleraehyq ? I can not reproduce, even with the exact same code

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

No branches or pull requests

3 participants