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
table: auto-merge issue with bottom cell separator #215
Comments
@andrewpmartinez - fixed this issue and cut a new tag for you: https://github.com/jedib0t/go-pretty/releases/tag/v6.3.5 Can you please try it and lemme know if that fixed it for you? |
Also, you can use nested tables for the Configuration column -- tables within tables -- instead of using auto-merge to achieve a table like the above. Lemme know if you have any questions. Sample: package main
import (
"fmt"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
)
func main() {
generateInnerTable := func() table.Writer {
tw := table.NewWriter()
tw.SetStyle(table.StyleRounded)
tw.Style().Options.DrawBorder = false
tw.SetColumnConfigs([]table.ColumnConfig{
{Number: 1, WidthMin: 16, WidthMax: 16},
{Number: 2, WidthMax: 32, WidthMaxEnforcer: text.WrapSoft},
})
return tw
}
twConfigurationMAC := generateInnerTable()
twConfigurationMAC.AppendRow(table.Row{"MAC Address", "4b3...ae2, 5bc...f57, 626...d05 9cb...c09, e04...d75, e0d...296 e58......"})
twConfigurationMFA := generateInnerTable()
twConfigurationMFA.AppendRow(table.Row{"Timeout", "never"})
twConfigurationMFA.AppendRow(table.Row{"Prompt on Wake", "false"})
twConfigurationMFA.AppendRow(table.Row{"Prompt on Unlock", "true"})
twConfigurationCheckMulti := generateInnerTable()
twConfigurationCheckMulti.AppendRow(table.Row{"Semantic", "AllOf"})
twConfigurationCheckMulti.AppendRow(table.Row{"Path", "C:\\process2.exe"})
twConfigurationCheckMulti.AppendRow(table.Row{"Hashes", "59e6...3f16"})
twConfigurationCheckMulti.AppendRow(table.Row{"Signers", "f56d...187a"})
tw := table.NewWriter()
tw.AppendHeader(table.Row{"ID", "Name", "Type", "Attributes", "Configuration"})
tw.AppendRow(table.Row{"DtMM5CCOZ", "macCheck", "MAC", "pc1", twConfigurationMAC.Render()})
tw.AppendRow(table.Row{"NA8HvBC3Z-", "mfaCheck", "MFA", "wiggle", twConfigurationMFA.Render()})
tw.AppendRow(table.Row{"e6YMDCC3K-", "processCheckMulti", "PROCESS_MULTI", "<none>", twConfigurationCheckMulti.Render()})
tw.SetStyle(table.StyleRounded)
tw.Style().Options.SeparateRows = true
fmt.Println(tw.Render())
} Output:
|
It does, thank you again! |
That did it, thank you very much!
Unrelated but looks like the last horizontal line that has auto merge has a single vertical bar tick at the end. In the output below you can see it after
cf01
on the last line. Let me know if you want a separate issue logged.Originally posted by @andrewpmartinez in #207 (comment)
The text was updated successfully, but these errors were encountered: