You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
)
func main() {
tw := table.NewWriter()
tw.AppendHeader(table.Row{"ID", "Date", "From", "To", "Subject", "Size"})
tw.AppendRow(table.Row{
4,
"2024-11-18T09:30:54Z",
"Shaylee McDermott",
"",
"Tote bag photo booth lumbersexual normcore synth meh lumbersexual disrupt craft beer aesthetic.",
"4.2 MB",
})
tw.AppendRow(table.Row{
4,
"2024-11-18T09:30:54Z",
"Anahi Braun ",
"",
"Mumblecore salvia mumblecore austin tofu viral asymmetrical small batch distillery you probably haven't heard of them.",
"4.2 MB",
})
tw.AppendRow(table.Row{
4,
"2024-11-18T09:30:54Z",
"Brando Barton",
"",
"Before they sold out jean shorts chartreuse neutra fixie flexitarian goth art party small batch sriracha.",
"4.2 MB",
})
const ID = "AAMkADdiOWM1OTBkLTBhZjEtNGFiNS1hOGYwLTY2YWFmOGQyNTMxNgBGAAAAAADBju3TxrP2SZIsqjNb8hmoBwA9J0gY/4/nQ73Lmp9F9NoaAABlJ281AAA9J0gY/4/nQ73Lmp9F9NoaAABlJ6bLAAA="
tw.AppendRow(
table.Row{ID, ID, ID, ID, ID, ID},
table.RowConfig{
AutoMerge: true,
AutoMergeAlign: text.AlignLeft,
})
fmt.Println(tw.Render())
}
Expected behavior
+----+----------------------+-------------------+----+------------------------------------------------------------------------------------------------------------------------+--------+
| ID | DATE | FROM | TO | SUBJECT | SIZE |
+----+----------------------+-------------------+----+------------------------------------------------------------------------------------------------------------------------+--------+
| 4 | 2024-11-18T09:30:54Z | Shaylee McDermott | | Tote bag photo booth lumbersexual normcore synth meh lumbersexual disrupt craft beer aesthetic. | 4.2 MB |
| 4 | 2024-11-18T09:30:54Z | Anahi Braun | | Mumblecore salvia mumblecore austin tofu viral asymmetrical small batch distillery you probably haven't heard of them. | 4.2 MB |
| 4 | 2024-11-18T09:30:54Z | Brando Barton | | Before they sold out jean shorts chartreuse neutra fixie flexitarian goth art party small batch sriracha. | 4.2 MB |
| AAMkADdiOWM1OTBkLTBhZjEtNGFiNS1hOGYwLTY2YWFmOGQyNTMxNgBGAAAAAADBju3TxrP2SZIsqjNb8hmoBwA9J0gY/4/nQ73Lmp9F9NoaAABlJ281AAA9J0gY/4/nQ73Lmp9F9NoaAABlJ6bLAAA= |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Actual behavior
+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| ID | DATE | FROM | TO | SUBJECT | SIZE |
+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
| 4 | 2024-11-18T09:30:54Z | Shaylee McDermott | | Tote bag photo booth lumbersexual normcore synth meh lumbersexual disrupt craft beer aesthetic. | 4.2 MB |
| 4 | 2024-11-18T09:30:54Z | Anahi Braun | | Mumblecore salvia mumblecore austin tofu viral asymmetrical small batch distillery you probably haven't heard of them. | 4.2 MB |
| 4 | 2024-11-18T09:30:54Z | Brando Barton | | Before they sold out jean shorts chartreuse neutra fixie flexitarian goth art party small batch sriracha. | 4.2 MB |
| AAMkADdiOWM1OTBkLTBhZjEtNGFiNS1hOGYwLTY2YWFmOGQyNTMxNgBGAAAAAADBju3TxrP2SZIsqjNb8hmoBwA9J0gY/4/nQ73Lmp9F9NoaAABlJ281AAA9J0gY/4/nQ73Lmp9F9NoaAABlJ6bLAAA= |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Software:
GoLang Version 1.23
The text was updated successfully, but these errors were encountered:
fpawel
changed the title
A size of columns with merged cells is not calculated correctly
Bug: a size of columns with merged cells is not calculated correctly
Jan 14, 2025
Hello! Thank you for your work on this useful package!
Describe the bug
When calculating the size of columns, merging table cells is not taken into account
To Reproduce
Go Playground.
Expected behavior
Actual behavior
Software:
The text was updated successfully, but these errors were encountered: