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
Tables are awesome, however if I have a long line and it exceeds my terminals width, I'd like to be able to wrap based on cellwidth - i used cellwidth but it doesn't seem to have an impact on the table. Here's my code -
err:=termui.Init()
iferr!=nil {
panic(err)
}
defertermui.Close()
rows1:= [][]string{
[]string{"header1", "header2", "header3", "header4"},
[]string{"你好吗", "Go-lang is so cool", "Im working on Ruby a long sentance Im working on Ruby a long sentance Im working on Ruby a long sentance", "Im working on Ruby a long sentance Im working on Ruby a long sentance Im working on Ruby a long sentance"},
[]string{"2016", "10", "11", "11"},
}
table1:=termui.NewTable()
table1.Rows=rows1table1.FgColor=termui.ColorWhitetable1.BgColor=termui.ColorDefaulttable1.Y=0table1.X=0table1.Width=59table1.Height=7table1.Analysis()
table1.SetSize()
table1.CellWidth= []int{5,5,10, 5}
termui.Render(table1)
rows2:= [][]string{
[]string{"header1", "header2", "header3"},
[]string{"Foundations", "Go-lang is so cool", "Im working on Ruby"},
[]string{"2016", "11", "11"},
}
table2:=termui.NewTable()
table2.Rows=rows2table2.FgColor=termui.ColorWhitetable2.BgColor=termui.ColorDefaulttable2.TextAlign=termui.AlignLefttable2.Separator=falsetable2.Analysis()
table2.SetSize()
table2.BgColors[2] =termui.ColorRedtable2.Y=10table2.X=0table2.Border=truetermui.Render(table2)
termui.Handle("/sys/kbd/q", func(termui.Event) {
termui.StopLoop()
})
termui.Loop()
I want to be able to wrap for example 3rd (or 2nd if you prefer 0 indexing) to next row based on some parameter I desire it to be -- is there anything prebuilt like that?
The text was updated successfully, but these errors were encountered:
Tables are awesome, however if I have a long line and it exceeds my terminals width, I'd like to be able to wrap based on cellwidth - i used cellwidth but it doesn't seem to have an impact on the table. Here's my code -
I want to be able to wrap for example 3rd (or 2nd if you prefer 0 indexing) to next row based on some parameter I desire it to be -- is there anything prebuilt like that?
The text was updated successfully, but these errors were encountered: