go text/template with tabwriter
<p>I try to have a pretty table with text/template but the columns are not aligned.
text/tabwriter work but text/template make a cleaner code.</p>

<p>How can I use text/template with text/tabwriter?</p>

<p>This is my test : </p>

<pre><code>package main

import (
    "os"
    "text/template"
)

type a struct {
    Title string
    Items []items
}

type items struct {
    Title string
    Body  string
}

const templ = `{{.Title}}{{range .Items}}
{{.Title}}  {{.Body}}{{end}}
`

func main() {
    data := a{
        Title: "title1",
        Items: []items{
            {"item1", "body1"},
            {"item2", "body2"},
            {"verylongitem3", "body3"}},
    }
    t := template.New("test")
    t, _ = t.Parse(templ)
    t.Execute(os.Stdout, data)
}
</code></pre>

<p>Output : </p>

<pre><code>title1
item1   body1
item2   body2
verylongitem3   body3
</code></pre>