Open
Description
Describe the bug
The title row renders incorrently when set to a non-default style (StyleBold/StyleLight/...). It appears the layout fails to adjust for the width taken up by the title content.
To Reproduce
func main() {
t := table.NewWriter()
t.SetOutputMirror(os.Stdout)
t.SetTitle("SALARY Report")
t.SetStyle(table.StyleDouble)
t.AppendHeader(table.Row{"#", "First Name", "Last Name", "Salary"})
t.AppendRows([]table.Row{
{1, "Arya", "Stark", 3000},
{20, "Jon", "Snow", 2000},
})
t.AppendSeparator()
t.AppendRow([]interface{}{300, "Tyrion", "Lannister", 5000})
t.AppendFooter(table.Row{"", "", "Total", 10000})
t.Render()
}
Screenshots
┌──────────────────────────────────────────┐
│ SALARY Report │
├─────┬────────────┬───────────┬────────┤
│ # │ FIRST NAME │ LAST NAME │ SALARY │
├─────┼────────────┼───────────┼────────┤
│ 1 │ Arya │ Stark │ 3000 │
│ 20 │ Jon │ Snow │ 2000 │
├─────┼────────────┼───────────┼────────┤
│ 300 │ Tyrion │ Lannister │ 5000 │
├─────┼────────────┼───────────┼────────┤
│ │ │ TOTAL │ 10000 │
└─────┴────────────┴───────────┴────────┘
Software (please complete the following information):
- github.com/jedib0t/go-pretty/v6 v6.6.7
Metadata
Metadata
Assignees
Labels
No labels